aboutsummaryrefslogtreecommitdiff
path: root/prisma/removed.ts
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/removed.ts
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/removed.ts')
-rw-r--r--prisma/removed.ts10
1 files changed, 10 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;
+ }
+};