Skip to content

Commit e62959d

Browse files
authored
Fix plugin creation (#934)
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
1 parent b5cd4ee commit e62959d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pages/api/admin/plugins.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ export default async function handler(
2121
switch (req.method) {
2222
case "POST":
2323
// Used to edit or create a plugin
24-
const {
25-
body: { url = "", enabled = 0, settings = "{}" },
24+
let {
25+
// eslint-disable-next-line prefer-const
26+
body: { url = "", enabled = false, settings = "{}" },
2627
} = req;
28+
enabled = enabled ? 1 : 0;
2729
// Check if the plugin exists
2830
const plugin = await db
2931
.selectFrom("plugins")

0 commit comments

Comments
 (0)