Skip to content

Commit 8658304

Browse files
committed
Add ballot success field
1 parent 5ce811c commit 8658304

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable
2+
ALTER TABLE "User" ADD COLUMN "ballot_success" INTEGER;

prisma/schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ generator client {
1111
model User {
1212
id Int @id @default(autoincrement())
1313
address String @unique()
14+
ballotSuccess Int? @map("ballot_success")
1415
opAddress String? @unique() @map("op_address")
1516
isBadgeHolder Int @map("is_badgeholder")
1617
createdAt DateTime @default(now()) @map("created_at")

src/flow/flow.controller.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,24 @@ export class FlowController {
185185
return ballot;
186186
}
187187

188+
@UseGuards(AuthGuard)
189+
@ApiOperation({
190+
summary: 'Used for a pairwise vote between two collections',
191+
})
192+
@Get('/ballot/success')
193+
async successBallot(@Req() { userId }: AuthedReq) {
194+
await this.prismaService.user.update({
195+
where: {
196+
id: userId,
197+
},
198+
data: {
199+
ballotSuccess: 1,
200+
},
201+
});
202+
203+
return 'Success';
204+
}
205+
188206
@UseGuards(AuthGuard)
189207
@ApiOperation({
190208
summary: 'Used for a pairwise vote between two collections',

0 commit comments

Comments
 (0)