Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewquang512 committed Nov 2, 2023
1 parent 781f400 commit 3afcc1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/resolvers/Query/IMAGE.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ const imageQuery = {

allImages.map(async (img) => {
for (const refImage of referenceImages) {
if (compareImages(refImage.url, img.url)) {
result.push(img);
try {
const isSimilar = await compareImages(refImage.url, img.url)
if (isSimilar) {
result.push(img);
}
} catch (error) {
console.error(error)
return
}
}
});
Expand Down
3 changes: 2 additions & 1 deletion src/resolvers/Query/POST.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ const postQuery = {
allImages = _.filter(allImages, (o) => o.id != currentImage.id);

allImages.map(async (img) => {
if (compareImages(currentImage.url, img.url)) {
const isSimilar = await compareImages(currentImage.url, img.url)
if (isSimilar) {
result.push(img);
}
});
Expand Down

0 comments on commit 3afcc1b

Please sign in to comment.