diff options
| author | Factiven <[email protected]> | 2024-01-11 14:23:15 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2024-01-11 14:23:15 +0700 |
| commit | e9aea5ffe32cf43ae0ac0f3d692ea6c9202bc579 (patch) | |
| tree | 0f792b478c2dfa20ddad0f20abb9a82b1024817f /prisma | |
| parent | feat: Add PreviousEpisode and NextEpisode to media controls (#111) (diff) | |
| download | moopa-e9aea5ffe32cf43ae0ac0f3d692ea6c9202bc579.tar.xz moopa-e9aea5ffe32cf43ae0ac0f3d692ea6c9202bc579.zip | |
Add getRemovedMedia function and handle redirect for removed media
Diffstat (limited to 'prisma')
| -rw-r--r-- | prisma/removed.ts | 10 | ||||
| -rw-r--r-- | prisma/schema.prisma | 6 |
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 |