refactor(ux): consolidate BMAD skills, update design system, and clean up Prisma generated client
This commit is contained in:
@@ -1,25 +1,17 @@
|
||||
import prisma from './prisma'
|
||||
import { unstable_cache } from 'next/cache'
|
||||
|
||||
const getCachedSystemConfig = unstable_cache(
|
||||
async () => {
|
||||
try {
|
||||
const configs = await prisma.systemConfig.findMany()
|
||||
return configs.reduce((acc, conf) => {
|
||||
acc[conf.key] = conf.value
|
||||
return acc
|
||||
}, {} as Record<string, string>)
|
||||
} catch (e) {
|
||||
console.error('Failed to load system config from DB:', e)
|
||||
return {}
|
||||
}
|
||||
},
|
||||
['system-config'],
|
||||
{ tags: ['system-config'] }
|
||||
)
|
||||
|
||||
export async function getSystemConfig() {
|
||||
return getCachedSystemConfig()
|
||||
try {
|
||||
const configs = await prisma.systemConfig.findMany()
|
||||
return configs.reduce((acc, conf) => {
|
||||
acc[conf.key] = conf.value
|
||||
return acc
|
||||
}, {} as Record<string, string>)
|
||||
} catch (e) {
|
||||
console.error('Failed to load system config from DB:', e)
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user