diff --git a/server/database.types.ts b/server/database.types.ts index 6700e20..11d705d 100644 --- a/server/database.types.ts +++ b/server/database.types.ts @@ -418,6 +418,7 @@ export type Database = { picture: string comments: number likes: number + account: string }[] } select_liked_posts: { @@ -436,6 +437,7 @@ export type Database = { picture: string comments: number likes: number + account: string }[] } select_posts_by_word: { @@ -455,6 +457,7 @@ export type Database = { picture: string comments: number likes: number + account: string }[] } } diff --git a/server/db.ts b/server/db.ts index 53b0e4b..ba5b5da 100644 --- a/server/db.ts +++ b/server/db.ts @@ -229,9 +229,7 @@ export async function selectFollowingUsersPosts( if (error) { throw error; } - return data.map((row) => { - return { ...row, account: null }; - }) ?? []; + return data ?? []; } export async function selectLikedPosts( @@ -244,9 +242,7 @@ export async function selectLikedPosts( if (error) { throw error; } - return data.map((row) => { - return { ...row, account: null }; - }) ?? []; + return data ?? []; } export async function selectPostsBySearchWord( @@ -268,9 +264,7 @@ export async function selectPostsBySearchWord( if (error) { throw error; } - return data.map((row) => { - return { ...row, account: null }; - }) ?? []; + return data ?? []; } export async function insertComment(