mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-03 08:36:01 +00:00
Merge remote-tracking branch 'origin/main' into release/0.12
# Conflicts: # app/__test__/modules/ModuleManager.spec.ts # app/src/modules/ModuleManager.ts
This commit is contained in:
@@ -61,6 +61,19 @@ export class AppData extends Module<typeof dataConfigSchema> {
|
||||
this.setBuilt();
|
||||
}
|
||||
|
||||
override async onBeforeUpdate(from: AppDataConfig, to: AppDataConfig): Promise<AppDataConfig> {
|
||||
// this is not 100% yet, since it could be legit
|
||||
const entities = {
|
||||
from: Object.keys(from.entities ?? {}),
|
||||
to: Object.keys(to.entities ?? {}),
|
||||
};
|
||||
if (entities.from.length - entities.to.length > 1) {
|
||||
throw new Error("Cannot remove more than one entity at a time");
|
||||
}
|
||||
|
||||
return to;
|
||||
}
|
||||
|
||||
getSchema() {
|
||||
return dataConfigSchema;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user