26 lines
451 B
TypeScript
26 lines
451 B
TypeScript
"use server"
|
|
import prisma from "./db"
|
|
export async function getStories() {
|
|
return prisma.story.findMany()
|
|
}
|
|
export async function getStoriesWithGenres() {
|
|
return prisma.story.findMany(
|
|
{
|
|
include: {
|
|
genres: true
|
|
}
|
|
}
|
|
|
|
)
|
|
}
|
|
export async function getPubs() {
|
|
return prisma.pub.findMany()
|
|
}
|
|
export async function getGenres() {
|
|
return prisma.genre.findMany()
|
|
}
|
|
export async function getResponses() {
|
|
return prisma.response.findMany()
|
|
}
|
|
|