Skip to content

Commit cbae283

Browse files
authored
Merge pull request #139 from fredrikj31/list-posts-fix
list posts fix
2 parents 5ce2f5c + a7e9063 commit cbae283

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

api/src/services/database/queries/posts/listPosts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const listPosts = async (
3030
) as user
3131
FROM
3232
posts
33-
JOIN friends ON friends.friend_id = posts.user_id
33+
LEFT JOIN friends ON friends.friend_id = posts.user_id
3434
JOIN profiles ON profiles.user_id = posts.user_id
3535
WHERE
3636
(

app/src/components/Post/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { useDeletePost } from "../../api/posts/deletePost/useDeletePost";
2929
import { useToast } from "@shadcn-ui/components/ui/use-toast";
3030
import { useAuth } from "../../providers/auth";
3131
import { useQueryClient } from "@tanstack/react-query";
32+
import { config } from "../../config";
3233

3334
interface PostProps {
3435
post: PostWithUser;
@@ -68,7 +69,10 @@ export const Post = ({ post }: PostProps) => {
6869
<CardHeader className="flex flex-row justify-between">
6970
<div className="flex flex-row items-center gap-2">
7071
<Avatar className="size-10">
71-
<AvatarImage src="https://github.com/shadcn.png" />
72+
<AvatarImage
73+
className="object-cover"
74+
src={`${config.assets.baseUrl}/profiles/${post.user.userId}`}
75+
/>
7276
<AvatarFallback>CN</AvatarFallback>
7377
</Avatar>
7478
<div className="flex flex-col">

0 commit comments

Comments
 (0)