Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chibat committed Feb 21, 2024
1 parent 7080a7d commit 0be3697
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
3 changes: 3 additions & 0 deletions server/database.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ export type Database = {
picture: string
comments: number
likes: number
account: string
}[]
}
select_liked_posts: {
Expand All @@ -436,6 +437,7 @@ export type Database = {
picture: string
comments: number
likes: number
account: string
}[]
}
select_posts_by_word: {
Expand All @@ -455,6 +457,7 @@ export type Database = {
picture: string
comments: number
likes: number
account: string
}[]
}
}
Expand Down
12 changes: 3 additions & 9 deletions server/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 0be3697

Please sign in to comment.