update
This commit is contained in:
parent
176e1f9032
commit
ff355f5d8b
|
@ -82,10 +82,18 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
this.userProfilesRepository.update({ userId: user.id }, {
|
||||
loggedInDates: [...userProfile.loggedInDates, today],
|
||||
});
|
||||
this.usersRepository.update( user.id, {
|
||||
getPoints: user.getPoints + todayGetPoints,
|
||||
const user_ = await this.usersRepository.findOne({
|
||||
where: {
|
||||
id: user.id,
|
||||
},
|
||||
});
|
||||
this.notificationService.createNotification(user. id, 'loginbonus', {
|
||||
if (user_ == null) {
|
||||
throw new ApiError(meta.errors.userIsDeleted);
|
||||
}
|
||||
this.usersRepository.update( user.id, {
|
||||
getPoints: user_.getPoints + todayGetPoints,
|
||||
});
|
||||
this.notificationService.createNotification(user.id, 'loginbonus', {
|
||||
loginbonus: todayGetPoints,
|
||||
});
|
||||
userProfile.loggedInDates = [...userProfile.loggedInDates, today];
|
||||
|
|
Loading…
Reference in New Issue