This commit is contained in:
Jesper Møller Jensen
2023-01-23 02:31:45 +01:00
parent d2ba007ac6
commit aaa00240c8

View File

@@ -49,16 +49,16 @@ export class UmbLanguageStore extends UmbDataStoreBase<UmbLanguageStoreItemType>
async save(language: LanguageDetails): Promise<void> {
if (language.id && language.key) {
tryExecuteAndNotify(this.host, LanguageResource.putLanguageById({ id: language.id, requestBody: language })).then(
(data) => {
if (data) {
this.updateItems([data.data]);
(response) => {
if (response.data) {
this.updateItems([response.data]);
}
}
);
} else {
tryExecuteAndNotify(this.host, LanguageResource.postLanguage({ requestBody: language })).then((data) => {
if (data) {
this.updateItems([data.data]);
tryExecuteAndNotify(this.host, LanguageResource.postLanguage({ requestBody: language })).then((response) => {
if (response.data) {
this.updateItems([response.data]);
}
});
}