feat(backend): implement Phase A database models and controllers for cross-boundary dependencies
Deploy Canina / deploy (push) Failing after 28s

This commit is contained in:
parsa committed 2026-08-06 23:45:51 +03:30
1 parent 74fcaa6a4e
commit 1ae4c99ffc
26 files changed
+1205 -345

No files matched your search

+26 -6
View File
@@ -22,18 +22,22 @@ export class SettingsService {
}
async upsertScientificTerm(key: string, data: any) {
const term = String(data?.term || '');
const definition = String(data?.definition || '');
const wikiId = String(data?.wikiId || 'general');
return this.prisma.scientificTerm.upsert({
where: { key },
update: {
term: data.term,
definition: data.definition,
wikiId: data.wikiId || 'general',
term,
definition,
wikiId,
},
create: {
key,
term: data.term,
definition: data.definition,
wikiId: data.wikiId || 'general',
term,
definition,
wikiId,
},
});
}
@@ -43,4 +47,20 @@ export class SettingsService {
where: { key },
});
}
async getCategorySetting(category: string) {
const setting = await this.prisma.setting.findFirst({
where: { category },
});
return setting ? setting.value : {};
}
async updateCategorySetting(category: string, value: any) {
const key = `${category}_config`;
return this.prisma.setting.upsert({
where: { key },
update: { category, value },
create: { key, category, value },
});
}
}