chore: update post model
This commit is contained in:
@@ -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,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user