Skip to content

Commit

Permalink
fix recordBuzz admin logic
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey-wu committed Jul 6, 2023
1 parent 6394e12 commit 19f0d97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion database/geoword.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,11 @@ async function getUserStats({ packetName, user_id }) {
* @param {ObjectId} params.user_id
*/
async function recordBuzz({ celerity, givenAnswer, points, packetName, questionNumber, user_id }) {
const username = await getUsername(user_id);
const [division, packet, admin] = await Promise.all([
getDivisionChoiceById(packetName, user_id),
packets.findOne({ name: packetName }),
isAdmin(user_id),
isAdmin(username),
]);

await buzzes.replaceOne(
Expand Down

0 comments on commit 19f0d97

Please sign in to comment.