Skip to content

Commit

Permalink
fix: Await achievement promise request
Browse files Browse the repository at this point in the history
  • Loading branch information
anshg1214 committed Jan 16, 2024
1 parent 7c42dfa commit 5bed9a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/routes/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ router.get('/:id/achievements', async (req, res, next) => {
.where('editor_id', userId)
.fetchAll({require: false});

const achievementCol = new AchievementUnlock()
const achievementColPromise = new AchievementUnlock()
.where('editor_id', userId)
.where('profile_rank', '<=', '3')
.query((qb) => qb.limit(3))
Expand All @@ -545,8 +545,8 @@ router.get('/:id/achievements', async (req, res, next) => {
.orderBy('id', 'ASC')
.fetchAll();

const [unlocks, editorJSON, achievementTypes] = await Promise.all([
unlocksPromise, editorJSONPromise, achievementTypesPromise, achievementCol
const [unlocks, editorJSON, achievementTypes, achievementCol] = await Promise.all([
unlocksPromise, editorJSONPromise, achievementTypesPromise, achievementColPromise
]);

const achievementJSON =
Expand Down

0 comments on commit 5bed9a1

Please sign in to comment.