Files
drop/server/plugins/setup.ts
DecDuck b2ab827a55 add proper carousel to store page
uses the VueCarousel library to add an actual carousel to the store page
for the images. uses responsive styles
2024-10-27 15:21:31 +11:00

26 lines
482 B
TypeScript

import prisma from "../internal/db/database";
export default defineNitroPlugin(async (nitro) => {
const userCount = await prisma.user.count({});
if (userCount != 0) return;
// This setup runs every time the server sets up,
// so it should be in-place
// Create admin invitation
await prisma.invitation.upsert({
where: {
id: "admin",
},
create: {
id: "admin",
isAdmin: true,
},
update: {
isAdmin: true,
},
});
});