File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 1
- import { Query , QueryBuilder } from "@topcoder-framework/client-relational" ;
1
+ import { Query , QueryBuilder , Operator } from "@topcoder-framework/client-relational" ;
2
2
import { CreateResult , ScanRequest , UpdateResult } from "@topcoder-framework/lib-common" ;
3
3
import { Util } from "../common/Util" ;
4
4
import { queryRunner } from "../helper/QueryRunner" ;
5
5
import {
6
6
CreatePrizeInput ,
7
+ DeletePrizeInput ,
7
8
Prize ,
8
9
PrizeList ,
9
10
UpdatePrizeInput ,
@@ -67,6 +68,26 @@ class PrizeDomain {
67
68
updatedCount : affectedRows ! ,
68
69
} ;
69
70
}
71
+
72
+ public async delete ( input : DeletePrizeInput ) {
73
+ await queryRunner . run (
74
+ new QueryBuilder ( PrizeSchema )
75
+ . delete ( )
76
+ . where ( PrizeSchema . columns . projectId , Operator . OPERATOR_EQUAL , {
77
+ value : {
78
+ $case : "intValue" ,
79
+ intValue : input . projectId ,
80
+ } ,
81
+ } )
82
+ . andWhere ( PrizeSchema . columns . prizeId , Operator . OPERATOR_EQUAL , {
83
+ value : {
84
+ $case : "intValue" ,
85
+ intValue : input . prizeId ,
86
+ } ,
87
+ } )
88
+ . build ( )
89
+ ) ;
90
+ }
70
91
}
71
92
72
93
export default new PrizeDomain ( ) ;
You can’t perform that action at this time.
0 commit comments