Skip to content

Commit

Permalink
알람 API 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
wook-hyung committed Dec 16, 2023
1 parent 7de9b9c commit 39dbf2d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion controllers/challengeController.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { challengeService } = require('../services/challengeService');
const { challengeCertificationModel } = require('../models/challengeCertificationModel');
const { alarmService } = require('../services/alarmService');
const { getUserIdFromJwt } = require('../utils/jwt');
const { getUserChampionFromJwt } = require('../utils/jwt');
Expand Down Expand Up @@ -162,9 +163,14 @@ const challengeController = {
participationCount: participationCount + 1,
});

const [{ member_id: memberIdForAlarm }] =
await challengeCertificationModel.findMemberIdByChallengeCertificationId({
challengeCertificationId: submitResult.data.insertId,
});

// TODO: 새로운 인증 요청 알람을 상대방에게 전송한다.
await alarmService.createCertificationAlarm({
memberId,
memberId: memberIdForAlarm,
challengeCertificationId: submitResult.data.insertId,
});

Expand Down

0 comments on commit 39dbf2d

Please sign in to comment.