File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
migrations/20241003194312_ Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ -- AlterTable
2+ ALTER TABLE " User" ADD COLUMN " ballot_success" INTEGER ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ generator client {
1111model 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 " )
Original file line number Diff line number Diff 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' ,
You can’t perform that action at this time.
0 commit comments