File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
services/hexathons/src/routes Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,25 @@ hexathonUserRouter.route("/:hexathonId/users/:userId").get(
8282 } )
8383) ;
8484
85+ hexathonUserRouter . route ( "/:hexathonId/refresh-users-points" ) . get (
86+ checkAbility ( "update" , "HexathonUser" ) ,
87+ asyncHandler ( async ( req , res ) => {
88+ const hexathonUsers = await HexathonUserModel . find ( {
89+ hexathon : req . params . hexathonId ,
90+ } ) ;
91+
92+ const updatedUsers = await Promise . all (
93+ hexathonUsers . map ( user =>
94+ getHexathonUserWithUpdatedPoints ( req , user . userId , req . params . hexathonId )
95+ )
96+ ) ;
97+
98+ return res . send ( {
99+ updatedCount : updatedUsers . length ,
100+ } ) ;
101+ } )
102+ ) ;
103+
85104hexathonUserRouter . route ( "/:hexathonId/users/:userId" ) . patch (
86105 checkAbility ( "update" , "HexathonUser" ) ,
87106 asyncHandler ( async ( req , res ) => {
You can’t perform that action at this time.
0 commit comments