@farris/bef
Advanced tools
Comparing version 0.0.11-201811291600 to 0.0.11-201812051153
@@ -515,3 +515,3 @@ (function (global, factory) { | ||
this.httpClient = httpClient; | ||
this.baseUri = "/" + beUri; | ||
this.baseUri = serverUri + "/" + beUri; | ||
this.sessionService = new BefSessionService(httpClient, serverUri, beUri); | ||
@@ -956,4 +956,5 @@ } | ||
*/ | ||
BefRepository.prototype.removeById = function (id) { | ||
BefRepository.prototype.removeById = function (id, ifSave) { | ||
var _this = this; | ||
ifSave = (ifSave === undefined) ? true : ifSave; | ||
// 服务器端删除 | ||
@@ -963,3 +964,11 @@ var delete$ = this.restService.delete(id); | ||
return delete$.pipe(switchMap.switchMap(function () { | ||
return _this.applyChangesById(id); | ||
// 从实体集合中删除 | ||
_this.entityCollection.removeEntityById(id); | ||
// 执行保存 | ||
if (ifSave === true) { | ||
return _this.applyChangesById(id); | ||
} | ||
else { | ||
return of.of(true); | ||
} | ||
})); | ||
@@ -1006,5 +1015,10 @@ }; | ||
var entity = this.entityCollection.getEntityById(id); | ||
if (entity.changes && entity.changes.length === 0) { | ||
// 变更集不存在 | ||
if (!entity.changes) { | ||
return of.of(true); | ||
} | ||
// 变更集为空 | ||
if (entity.changes.length === 0) { | ||
return of.of(true); | ||
} | ||
var changeDetail = this.changeBuilder.build(entity.changes); | ||
@@ -1011,0 +1025,0 @@ var update$ = this.restService.update(changeDetail); |
@@ -502,3 +502,3 @@ import { InjectionToken, Injectable, Inject } from '@angular/core'; | ||
this.httpClient = httpClient; | ||
this.baseUri = `/${beUri}`; | ||
this.baseUri = `${serverUri}/${beUri}`; | ||
this.sessionService = new BefSessionService(httpClient, serverUri, beUri); | ||
@@ -917,3 +917,4 @@ } | ||
*/ | ||
removeById(id) { | ||
removeById(id, ifSave) { | ||
ifSave = (ifSave === undefined) ? true : ifSave; | ||
// 服务器端删除 | ||
@@ -923,3 +924,11 @@ const delete$ = this.restService.delete(id); | ||
return delete$.pipe(switchMap(() => { | ||
return this.applyChangesById(id); | ||
// 从实体集合中删除 | ||
this.entityCollection.removeEntityById(id); | ||
// 执行保存 | ||
if (ifSave === true) { | ||
return this.applyChangesById(id); | ||
} | ||
else { | ||
return of(true); | ||
} | ||
})); | ||
@@ -965,5 +974,10 @@ } | ||
const entity = this.entityCollection.getEntityById(id); | ||
if (entity.changes && entity.changes.length === 0) { | ||
// 变更集不存在 | ||
if (!entity.changes) { | ||
return of(true); | ||
} | ||
// 变更集为空 | ||
if (entity.changes.length === 0) { | ||
return of(true); | ||
} | ||
const changeDetail = this.changeBuilder.build(entity.changes); | ||
@@ -970,0 +984,0 @@ const update$ = this.restService.update(changeDetail); |
@@ -518,3 +518,3 @@ import { InjectionToken, Injectable, Inject } from '@angular/core'; | ||
this.httpClient = httpClient; | ||
this.baseUri = "/" + beUri; | ||
this.baseUri = serverUri + "/" + beUri; | ||
this.sessionService = new BefSessionService(httpClient, serverUri, beUri); | ||
@@ -959,4 +959,5 @@ } | ||
*/ | ||
BefRepository.prototype.removeById = function (id) { | ||
BefRepository.prototype.removeById = function (id, ifSave) { | ||
var _this = this; | ||
ifSave = (ifSave === undefined) ? true : ifSave; | ||
// 服务器端删除 | ||
@@ -966,3 +967,11 @@ var delete$ = this.restService.delete(id); | ||
return delete$.pipe(switchMap(function () { | ||
return _this.applyChangesById(id); | ||
// 从实体集合中删除 | ||
_this.entityCollection.removeEntityById(id); | ||
// 执行保存 | ||
if (ifSave === true) { | ||
return _this.applyChangesById(id); | ||
} | ||
else { | ||
return of(true); | ||
} | ||
})); | ||
@@ -1009,5 +1018,10 @@ }; | ||
var entity = this.entityCollection.getEntityById(id); | ||
if (entity.changes && entity.changes.length === 0) { | ||
// 变更集不存在 | ||
if (!entity.changes) { | ||
return of(true); | ||
} | ||
// 变更集为空 | ||
if (entity.changes.length === 0) { | ||
return of(true); | ||
} | ||
var changeDetail = this.changeBuilder.build(entity.changes); | ||
@@ -1014,0 +1028,0 @@ var update$ = this.restService.update(changeDetail); |
{ | ||
"name": "@farris/bef", | ||
"version": "0.0.11-201811291600", | ||
"version": "0.0.11-201812051153", | ||
"description": "Farris Bef", | ||
@@ -5,0 +5,0 @@ "main": "./bundles/index.umd.js", |
@@ -86,3 +86,3 @@ import { HttpClient } from '@angular/common/http'; | ||
*/ | ||
removeById(id: string): Observable<boolean>; | ||
removeById(id: string, ifSave?: boolean): Observable<boolean>; | ||
/** | ||
@@ -89,0 +89,0 @@ * 批量删除 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
366427
3800
0