Skip to content

Commit

Permalink
pages/movies/:id : use real user id to find own comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mirsella committed Dec 22, 2024
1 parent 5a6028b commit f1cf3e1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pages/movies/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { data: infos, error: infos_error } = await useFetch(
`/api/movies/${movie_id}`,
{ headers },
);
const { data: user } = await useFetch(`/api/users/me`, { headers });
const { data: subtitles } = await useFetch(
`/api/movies/${movie_id}/subtitles`,
{ headers },
Expand Down Expand Up @@ -158,11 +159,12 @@ async function update_comment(comment_id: string) {
</button>
</div>
<div class="mr-20">
<!-- TODO: use real user id to compare if its our comment -->
<div
v-for="comment of comments"
class="chat"
:class="[true ? 'chat-end' : 'chat-start']"
:class="[
comment.comments.authorId == user?.id ? 'chat-end' : 'chat-start',
]"
>
<div class="chat-header text-lg ml-1">
user <b>{{ comment.users?.username || "deleted" }}</b> on
Expand All @@ -179,8 +181,10 @@ async function update_comment(comment_id: string) {
v-model="comments_input[comment.comments.id]"
/>
</div>
<!-- TODO: also use real user it here -->
<div v-if="true" class="chat-image">
<div
v-if="comment.comments.authorId == user?.id"
class="chat-image"
>
<button
v-show="
comments_input[comment.comments.id] !==
Expand Down

0 comments on commit f1cf3e1

Please sign in to comment.