We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 641d1cf commit 30dbc89Copy full SHA for 30dbc89
src/user/user.service.ts
@@ -243,6 +243,30 @@ export class UserService {
243
type: ActionType.VOTED,
244
},
245
});
246
+ const pollsParticipatedCount = await prisma.userAction.count({
247
+ where: {
248
+ userId: user.id,
249
+ type: ActionType.VOTED,
250
+ },
251
+ });
252
+ const participantCount = await prisma.userAction.count({
253
254
+ pollId: dto.pollId,
255
256
257
258
+ await prisma.user.update({
259
+ where: { worldID: dto.worldID },
260
+ data: {
261
+ pollsParticipatedCount,
262
263
264
+ await prisma.poll.update({
265
+ where: { pollId: dto.pollId },
266
267
+ participantCount,
268
269
270
return {
271
voteID: vote.voteID,
272
actionId: action.id,
0 commit comments