Skip to content

Commit

Permalink
feat: add logging for mutating form actions
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiDood committed Jul 11, 2024
1 parent 9abe612 commit c46cf50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/routes/dashboard/(draft)/drafts/+page.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ export const actions = {
assert(labCount > 0);
if (studentCount <= 0) error(403);

const result = await db.incrementDraftRound(draft);
assert(result !== null);
const incrementDraftRound = await db.incrementDraftRound(draft);
assert(incrementDraftRound !== null);
db.logger.info({ incrementDraftRound });

const ackCount = await db.autoAcknowledgeLabsWithoutPreferences(draft);
assert(ackCount < labCount);
db.logger.info({ autoAcknowledgeLabsWithoutPreferences: ackCount });
});
},
};
1 change: 1 addition & 0 deletions src/routes/dashboard/(draft)/students/+page.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const actions = {
const round = await db.incrementDraftRound(draft);
assert(round !== null);
if (round.curr_round > round.max_rounds) break;
db.logger.info({ incrementDraftRound: round });

const autoAcknowledgeLabsWithoutPreferences = await db.autoAcknowledgeLabsWithoutPreferences(draft);
db.logger.info({ autoAcknowledgeLabsWithoutPreferences });
Expand Down

0 comments on commit c46cf50

Please sign in to comment.