diff --git a/prisma/schema/content.prisma b/prisma/schema/content.prisma index b099ff9..dc278a1 100644 --- a/prisma/schema/content.prisma +++ b/prisma/schema/content.prisma @@ -29,7 +29,9 @@ model Game { mImageLibrary String[] // linked to objects in s3 versions GameVersion[] - libraryBasePath String @unique // Base dir for all the game versions + libraryBasePath String @unique // Base dir for all the game versions + + collections CollectionEntry[] @@unique([metadataSource, metadataId], name: "metadataKey") } diff --git a/prisma/schema/user.prisma b/prisma/schema/user.prisma index 518297b..0e46c0d 100644 --- a/prisma/schema/user.prisma +++ b/prisma/schema/user.prisma @@ -7,10 +7,10 @@ model User { displayName String profilePicture String // Object - authMecs LinkedAuthMec[] - clients Client[] - + authMecs LinkedAuthMec[] + clients Client[] notifications Notification[] + collections Collection[] } model Notification { @@ -21,7 +21,7 @@ model Notification { userId String user User @relation(fields: [userId], references: [id]) - created DateTime @default(now()) + created DateTime @default(now()) title String description String actions String[] diff --git a/server/api/v1/admin/user/index.get.ts b/server/api/v1/admin/user/index.get.ts new file mode 100644 index 0000000..b241860 --- /dev/null +++ b/server/api/v1/admin/user/index.get.ts @@ -0,0 +1,10 @@ +import prisma from "~/server/internal/db/database"; + +export default defineEventHandler(async (h3) => { + const user = await h3.context.session.getAdminUser(h3); + if (!user) throw createError({ statusCode: 403 }); + + const users = await prisma.user.findMany({}); + + return users; +});