Skip to content

Commit 4c8126c

Browse files
yyyortCopilot
andauthored
Apply suggestions from code review
copilot code improvement suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 27229b1 commit 4c8126c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/codebility/app/home/feeds/_components/PostUpvote.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default function PostUpvote({ post }: PostUpvoteProps) {
6464
if (!isUpvoted) {
6565
const postUpvote = await AddPostUpvote(post.id, user.id);
6666
} else {
67-
removePostUpvote(post.id, user.id);
67+
await removePostUpvote(post.id, user.id);
6868
}
6969

7070
await fetchPosts();

‎apps/codebility/app/home/feeds/_services/action.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export const hasUserUpvoted = async (postId: string, userId: string): Promise<bo
260260
try {
261261
const supabase = await createClientServerComponent();
262262

263-
const { data: postUpvote, error} = await supabase
263+
const { data: postUpvote, error } = await supabase
264264
.from("post_upvotes")
265265
.select("*")
266266
.eq("post_id", postId)
@@ -284,7 +284,7 @@ export const countUpvotes = async (postId: string): Promise<number> => {
284284
try {
285285
const supabase = await createClientServerComponent();
286286

287-
const { count, error} = await supabase
287+
const { count, error } = await supabase
288288
.from("post_upvotes")
289289
.select("*", { count: "exact", head: true })
290290
.eq("post_id", postId);

0 commit comments

Comments
 (0)