Merge pull request 'chore(plugins): cast config en Prisma.InputJsonValue' (#24) from chore/plugin-json-type into main

This commit is contained in:
tarzzan 2026-05-30 23:30:25 +00:00
commit dc05fe118b

View file

@ -9,6 +9,7 @@
*/
import "server-only";
import { Prisma } from "@/generated/prisma/client";
import { prisma } from "@/lib/prisma";
import { PLUGINS, type PluginDescriptor } from "./registry";
import { pluginHooks } from "./hooks";
@ -123,7 +124,10 @@ export async function togglePlugin(key: string, enabled: boolean): Promise<Plugi
}
export async function updatePluginConfig(key: string, config: Record<string, unknown>): Promise<PluginRow | null> {
await prisma.plugin.update({ where: { key }, data: { config } });
await prisma.plugin.update({
where: { key },
data: { config: config as Prisma.InputJsonValue },
});
invalidatePluginCache();
return await getPluginState(key);
}