Skip to content

Commit

Permalink
fix: handle optional chaining for comment form value
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Feb 25, 2025
1 parent 03b8ef9 commit 446c463
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion js/app/component/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ export const card = (() => {
if (isGif) {
const img = await gif.cache(c.gif_url);
return temp + `
<img src="${img}" class="img-fluid mx-auto gif-image rounded-4" alt="selected-gif">
<div class="d-flex justify-content-center align-items-center my-2">
<img src="${img}" id="img-gif-${c.uuid}" class="img-fluid mx-auto gif-image rounded-4" alt="selected-gif">
</div>
`;
}

Expand Down
4 changes: 2 additions & 2 deletions js/app/component/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const comment = (() => {

const status = await request(HTTP_PUT, '/api/comment/' + owns.get(id))
.token(session.getToken())
.body(dto.updateCommentRequest(presence ? isPresent : null, form.value, gifId))
.body(dto.updateCommentRequest(presence ? isPresent : null, form?.value, gifId))
.send(dto.statusResponse)
.then((res) => res.data.status, () => false);

Expand Down Expand Up @@ -297,7 +297,7 @@ export const comment = (() => {

const response = await request(HTTP_POST, '/api/comment')
.token(session.getToken())
.body(dto.postCommentRequest(id, nameValue, isPresence, form.value, gifId))
.body(dto.postCommentRequest(id, nameValue, isPresence, form?.value, gifId))
.send(dto.getCommentResponse)
.then((res) => res, () => null);

Expand Down

0 comments on commit 446c463

Please sign in to comment.