RED-6910: fix adding causing deleting of current items.

This commit is contained in:
Dan Percic 2023-06-14 19:28:11 +03:00
parent 34f2e3102f
commit d288f9c7bc
2 changed files with 1 additions and 5 deletions

View File

@ -55,7 +55,6 @@ export class DictionaryScreenComponent implements OnInit {
null,
true,
DICTIONARY_TO_ENTRY_TYPE_MAP[this.type],
false,
);
await this._loadEntries();
} catch (e) {

View File

@ -103,7 +103,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);
@ -136,7 +135,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) {
@ -258,12 +257,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));