log armoire, quoest response and cron events to history

This commit is contained in:
Phillip Thelen
2024-08-22 15:20:02 +02:00
parent 62f5b9698a
commit 38cad7102f
7 changed files with 157 additions and 7 deletions

View File

@@ -19,6 +19,7 @@ import common from '../../../common';
import { sendNotification as sendPushNotification } from '../../libs/pushNotifications';
import { apiError } from '../../libs/apiError';
import { questActivityWebhook } from '../../libs/webhook';
import { model as UserHistory } from '../../models/userHistory';
const analytics = getAnalyticsServiceByEnvironment();
@@ -227,6 +228,10 @@ api.acceptQuest = {
uuid: user._id,
headers: req.headers,
});
await UserHistory.beginUserHistoryUpdate(user._id)
.withQuestInviteResponse(group.quest.key, 'accept')
.commit();
},
};
@@ -288,6 +293,10 @@ api.rejectQuest = {
uuid: user._id,
headers: req.headers,
});
await UserHistory.beginUserHistoryUpdate(user._id)
.withQuestInviteResponse(group.quest.key, 'reject')
.commit();
},
};