tsc fixes
This commit is contained in:
@@ -15,7 +15,6 @@ export * from './entity-action/index.js';
|
||||
export * from './entity-bulk-action/index.js';
|
||||
export * from './extension-registry/index.js';
|
||||
export * from './id/index.js';
|
||||
export * from './form/index.js';
|
||||
export * from './menu/index.js';
|
||||
export * from './modal/index.js';
|
||||
export * from './notification/index.js';
|
||||
|
||||
@@ -121,11 +121,16 @@ export class UmbLanguageWorkspaceContext
|
||||
const { data } = await this.repository.create(newData);
|
||||
if (data) {
|
||||
this.setIsNew(false);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
await this.repository.save(newData);
|
||||
const { data } = await this.repository.save(newData);
|
||||
if (data) {
|
||||
return true;
|
||||
}
|
||||
// TODO: Show validation errors as warnings?
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
|
||||
@@ -101,15 +101,21 @@ export class UmbUserGroupWorkspaceContext
|
||||
async submit() {
|
||||
if (!this.#data.value) return;
|
||||
|
||||
//TODO: Could we clean this code up?
|
||||
if (this.getIsNew()) {
|
||||
await this.repository.create(this.#data.value);
|
||||
const { data } = await this.repository.create(this.#data.value);
|
||||
if (data) {
|
||||
// If it went well, then its not new anymore?.
|
||||
this.setIsNew(false);
|
||||
return true;
|
||||
}
|
||||
} else if (this.#data.value.unique) {
|
||||
await this.repository.save(this.#data.value);
|
||||
} else return;
|
||||
const { data } = await this.repository.save(this.#data.value);
|
||||
if (data) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// If it went well, then its not new anymore?.
|
||||
this.setIsNew(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
|
||||
Reference in New Issue
Block a user