mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 15:46:29 +08:00
refactor(server): use feature model (#9932)
This commit is contained in:
@@ -126,14 +126,19 @@ export class Runtime implements OnModuleInit {
|
||||
V = FlattenedAppRuntimeConfig[K],
|
||||
>(key: K, value: V) {
|
||||
validateConfigType(key, value);
|
||||
const config = await this.db.runtimeConfig.update({
|
||||
const config = await this.db.runtimeConfig.upsert({
|
||||
where: {
|
||||
id: key,
|
||||
deletedAt: null,
|
||||
},
|
||||
data: {
|
||||
create: {
|
||||
...defaultRuntimeConfig[key],
|
||||
value: value as any,
|
||||
},
|
||||
update: {
|
||||
value: value as any,
|
||||
deletedAt: null,
|
||||
},
|
||||
});
|
||||
|
||||
await this.setCache(key, config.value as FlattenedAppRuntimeConfig[K]);
|
||||
|
||||
Reference in New Issue
Block a user