subman-nextjs/src/app/lib/get.ts

26 lines
451 B
TypeScript
Raw Normal View History

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() {
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
}
export async function getPubs() {
return prisma.pub.findMany()
}
2024-06-12 15:15:22 +00:00
export async function getGenres() {
return prisma.genre.findMany()
}
export async function getResponses() {
return prisma.response.findMany()
}
2024-06-12 15:15:22 +00:00