chore: update post model
This commit is contained in:
parent
5d870a2e4a
commit
bd16bc4fcf
@ -2,6 +2,9 @@ import { db } from "~/utils/db.server";
|
||||
|
||||
export const findPosts = async () => {
|
||||
return db.post.findMany({
|
||||
where: {
|
||||
isPublic: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
@ -15,9 +18,10 @@ export const findPosts = async () => {
|
||||
};
|
||||
|
||||
export const findPost = async (id: string) => {
|
||||
return db.post.findUnique({
|
||||
return db.post.findFirst({
|
||||
where: {
|
||||
id,
|
||||
isPublic: true,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
@ -15,6 +15,7 @@ model Post {
|
||||
title String
|
||||
description String?
|
||||
path String
|
||||
isPublic Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user