Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/comments-2-layers' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
omranjamal committed Sep 7, 2024
2 parents c8ff38e + a8f6c8d commit b2bc737
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions apps/jonogon-core/src/api/trpc/procedures/comments/crud.mts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const listComments = publicProcedure
.on('user_vote.user_id', '=', `${ctx.auth?.user_id}`),
)
.select(({fn}) => [
'users.username as username',
'users.name as username',
'users.id as user_id',
'users.picture as profile_picture',
'comments.created_by',
Expand Down Expand Up @@ -158,7 +158,7 @@ export const listReplies = publicProcedure
.on('user_vote.user_id', '=', `${ctx.auth?.user_id}`),
)
.select(({fn}) => [
'users.username as username',
'users.name as username',
'users.id as user_id',
'users.picture as profile_picture',
'comments.created_by',
Expand Down Expand Up @@ -263,7 +263,7 @@ export const createComment = protectedProcedure
(qb) =>
qb
.selectFrom('users')
.select('users.username')
.select('users.name')
.whereRef('users.id', '=', 'comments.created_by')
.as('username'),
(qb) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@ export default function Comment({data}: CommentProps) {
<div className="flex flex-col">
{data.username ? (
<>
<p>@imtiaz</p>
<p>{data.username}</p>
<p className="text-xs text-stone-500 ml-1">
Jonogon-User-1
Jonogon-User-{data.created_by}
</p>
</>
) : (
<>
<p className="ml-1">Jonogon-User-1</p>
<p className="ml-1">
Jonogon-User-{data.created_by}
</p>
</>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function Reply({
<div className="flex flex-col">
{data.username ? (
<>
<p>@{data.username}</p>
<p>{data.username}</p>
<p className="text-xs text-stone-500 ml-1">
Jonogon-User-{data.created_by}
</p>
Expand Down

0 comments on commit b2bc737

Please sign in to comment.