Skip to content

Commit

Permalink
fix: missing awaits, possible test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Feb 13, 2021
1 parent 9a6cf3d commit 7665adf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/topics/thumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Thumbs.associate = async function ({ id, path, score }) {
// Associate thumbnails with the main pid (only on local upload)
if (!isDraft && isLocal) {
const mainPid = (await topics.getMainPids([id]))[0];
posts.uploads.associate(mainPid, path.replace('/files/', ''));
await posts.uploads.associate(mainPid, path.replace('/files/', ''));
}
};

Expand Down Expand Up @@ -131,7 +131,7 @@ Thumbs.delete = async function (id, relativePath) {
await db.deleteObjectField(`topic:${id}`, 'numThumbs');
}
const mainPid = (await topics.getMainPids([id]))[0];
posts.uploads.dissociate(mainPid, relativePath.replace('/files/', ''));
await posts.uploads.dissociate(mainPid, relativePath.replace('/files/', ''));
}
}
};

0 comments on commit 7665adf

Please sign in to comment.