mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
log armoire, quoest response and cron events to history
This commit is contained in:
@@ -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();
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user