RED-6910, fix adding causing deleting of current items.
This commit is contained in:
parent
984708bac3
commit
532ee9fa06
@ -58,7 +58,6 @@ export class DictionaryScreenComponent implements OnInit {
|
||||
null,
|
||||
true,
|
||||
DICTIONARY_TO_ENTRY_TYPE_MAP[this.type],
|
||||
false,
|
||||
);
|
||||
await this.#loadEntries();
|
||||
} catch (e) {
|
||||
|
||||
@ -94,7 +94,6 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
dossierId: string,
|
||||
showToast = true,
|
||||
dictionaryEntryType = DictionaryEntryTypes.ENTRY,
|
||||
removeCurrent = true,
|
||||
) {
|
||||
const entriesToAdd: Array<string> = [];
|
||||
const initialEntriesSet = new Set(initialEntries);
|
||||
@ -127,7 +126,7 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
await this._deleteEntries(deletedEntries, dossierTemplateId, type, dictionaryEntryType, dossierId);
|
||||
}
|
||||
if (entriesToAdd.length) {
|
||||
await this._addEntries(entriesToAdd, dossierTemplateId, type, dictionaryEntryType, dossierId, removeCurrent);
|
||||
await this._addEntries(entriesToAdd, dossierTemplateId, type, dictionaryEntryType, dossierId);
|
||||
}
|
||||
|
||||
if (showToast) {
|
||||
@ -235,12 +234,10 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
type: string,
|
||||
dictionaryEntryType: DictionaryEntryType,
|
||||
dossierId: string,
|
||||
removeCurrent = true,
|
||||
) {
|
||||
const queryParams: List<QueryParam> = [
|
||||
{ key: 'dossierId', value: dossierId },
|
||||
{ key: 'dictionaryEntryType', value: dictionaryEntryType },
|
||||
{ key: 'removeCurrent', value: removeCurrent },
|
||||
];
|
||||
const url = `${this._defaultModelPath}/${type}/${dossierTemplateId}`;
|
||||
return firstValueFrom(this._post(entries, url, queryParams));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user