We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5cd4ee commit e62959dCopy full SHA for e62959d
pages/api/admin/plugins.ts
@@ -21,9 +21,11 @@ export default async function handler(
21
switch (req.method) {
22
case "POST":
23
// Used to edit or create a plugin
24
- const {
25
- body: { url = "", enabled = 0, settings = "{}" },
+ let {
+ // eslint-disable-next-line prefer-const
26
+ body: { url = "", enabled = false, settings = "{}" },
27
} = req;
28
+ enabled = enabled ? 1 : 0;
29
// Check if the plugin exists
30
const plugin = await db
31
.selectFrom("plugins")
0 commit comments