2024-06-13 10:11:09 +00:00
|
|
|
"use server"
|
2024-06-12 10:19:44 +00:00
|
|
|
import prisma from "./db"
|
|
|
|
export async function getStories() {
|
2024-06-19 09:53:35 +00:00
|
|
|
return prisma.story.findMany()
|
|
|
|
}
|
|
|
|
export async function getStoriesWithGenres() {
|
2024-06-19 09:33:27 +00:00
|
|
|
return prisma.story.findMany(
|
|
|
|
{
|
|
|
|
include: {
|
|
|
|
genres: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
2024-06-12 10:19:44 +00:00
|
|
|
}
|
2024-06-20 09:39:35 +00:00
|
|
|
|
2024-06-12 10:19:44 +00:00
|
|
|
export async function getPubs() {
|
|
|
|
return prisma.pub.findMany()
|
|
|
|
}
|
2024-06-20 08:35:25 +00:00
|
|
|
export async function getPubsWithGenres() {
|
|
|
|
return prisma.pub.findMany({
|
|
|
|
include: { genres: true }
|
|
|
|
})
|
|
|
|
}
|
2024-06-20 09:39:35 +00:00
|
|
|
|
2024-06-12 15:15:22 +00:00
|
|
|
export async function getGenres() {
|
|
|
|
return prisma.genre.findMany()
|
|
|
|
}
|
2024-06-13 19:52:44 +00:00
|
|
|
export async function getResponses() {
|
|
|
|
return prisma.response.findMany()
|
|
|
|
}
|
2024-06-12 15:15:22 +00:00
|
|
|
|
2024-06-20 09:39:35 +00:00
|
|
|
export async function getSubs() {
|
|
|
|
return prisma.sub.findMany()
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function getSubsComplete() {
|
|
|
|
return prisma.sub.findMany({
|
|
|
|
include: {
|
|
|
|
story: true,
|
|
|
|
pub: true,
|
|
|
|
response: true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|