Skip to content

Commit

Permalink
fix: image source for question viewing
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielzxccc committed Dec 28, 2023
1 parent bb5e798 commit c94d2d7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/modules/Forums/ForumsInteractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ export async function viewQuestion(

if (!data) throw new HttpError('Question Not Found', 404)

const formattedQuestion = await replaceAvatarsWithUrls(data)
const dataWithImageSrc = data.imagesrc.map((item, _) => {
return getObjectUrl(item)
})

const formattedQuestion = await replaceAvatarsWithUrls({
...data,
imagesrc: dataWithImageSrc,
})

return { data: formattedQuestion, total }
}
Expand Down

0 comments on commit c94d2d7

Please sign in to comment.