mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
Revert "make non-fillable fields visible but disabled in UI"
This reverts commit f2aad9caac.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { transformObject } from "bknd/utils";
|
||||
import type { Kysely } from "kysely";
|
||||
import { set } from "lodash-es";
|
||||
import type { InitialModuleConfigs } from "modules/ModuleManager";
|
||||
|
||||
export type MigrationContext = {
|
||||
db: Kysely<any>;
|
||||
@@ -108,29 +107,6 @@ export const migrations: Migration[] = [
|
||||
return config;
|
||||
},
|
||||
},
|
||||
{
|
||||
// change field.config.fillable to only "create" and "update"
|
||||
version: 11,
|
||||
up: async (config: InitialModuleConfigs) => {
|
||||
const { data, ...rest } = config;
|
||||
return {
|
||||
...rest,
|
||||
data: {
|
||||
...data,
|
||||
entities: transformObject(data?.entities ?? {}, (entity) => {
|
||||
return {
|
||||
...entity,
|
||||
fields: transformObject(entity?.fields ?? {}, (field) => {
|
||||
const fillable = field!.config?.fillable;
|
||||
if (!fillable || typeof fillable === "boolean") return field;
|
||||
return { ...field, config: { ...field!.config, fillable: true } };
|
||||
}),
|
||||
};
|
||||
}),
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const CURRENT_VERSION = migrations[migrations.length - 1]?.version ?? 0;
|
||||
|
||||
Reference in New Issue
Block a user