aboutsummaryrefslogtreecommitdiff
path: root/prisma
diff options
context:
space:
mode:
authorFactiven <[email protected]>2024-01-11 14:23:15 +0700
committerFactiven <[email protected]>2024-01-11 14:23:15 +0700
commite9aea5ffe32cf43ae0ac0f3d692ea6c9202bc579 (patch)
tree0f792b478c2dfa20ddad0f20abb9a82b1024817f /prisma
parentfeat: Add PreviousEpisode and NextEpisode to media controls (#111) (diff)
downloadmoopa-e9aea5ffe32cf43ae0ac0f3d692ea6c9202bc579.tar.xz
moopa-e9aea5ffe32cf43ae0ac0f3d692ea6c9202bc579.zip
Add getRemovedMedia function and handle redirect for removed media
Diffstat (limited to 'prisma')
-rw-r--r--prisma/removed.ts10
-rw-r--r--prisma/schema.prisma6
2 files changed, 16 insertions, 0 deletions
diff --git a/prisma/removed.ts b/prisma/removed.ts
new file mode 100644
index 0000000..b6e31be
--- /dev/null
+++ b/prisma/removed.ts
@@ -0,0 +1,10 @@
+import { prisma } from "@/lib/prisma";
+
+export const getRemovedMedia = async (): Promise<any | null> => {
+ try {
+ const removedMedia = await prisma.removedMedia.findMany();
+ return removedMedia;
+ } catch (error) {
+ return null;
+ }
+};
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 040864e..d4b6607 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -7,6 +7,12 @@ generator client {
provider = "prisma-client-js"
}
+model RemovedMedia {
+ id String @id @default(cuid())
+ aniId String?
+ additions String[]
+}
+
model UserProfile {
id String @id @default(cuid())
name String @unique