Skip to content

Commit

Permalink
Merge pull request #53 from GeneralMagicio/staging
Browse files Browse the repository at this point in the history
Add ballot success field
  • Loading branch information
mmahdigh authored Oct 3, 2024
2 parents f2e8738 + 8658304 commit 8c1539b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions prisma/migrations/20241003194312_/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "ballot_success" INTEGER;
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ generator client {
model User {
id Int @id @default(autoincrement())
address String @unique()
ballotSuccess Int? @map("ballot_success")
opAddress String? @unique() @map("op_address")
isBadgeHolder Int @map("is_badgeholder")
createdAt DateTime @default(now()) @map("created_at")
Expand Down
18 changes: 18 additions & 0 deletions src/flow/flow.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,24 @@ export class FlowController {
return ballot;
}

@UseGuards(AuthGuard)
@ApiOperation({
summary: 'Used for a pairwise vote between two collections',
})
@Get('/ballot/success')
async successBallot(@Req() { userId }: AuthedReq) {
await this.prismaService.user.update({
where: {
id: userId,
},
data: {
ballotSuccess: 1,
},
});

return 'Success';
}

@UseGuards(AuthGuard)
@ApiOperation({
summary: 'Used for a pairwise vote between two collections',
Expand Down

0 comments on commit 8c1539b

Please sign in to comment.