File tree Expand file tree Collapse file tree
services/registration/src/routes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /* eslint-disable no-await-in-loop */
2+ import { MongoClient , ObjectId } from "mongodb" ;
3+
4+ // Throw and show a stack trace on an unhandled Promise rejection instead of logging an unhelpful warning
5+ process . on ( "unhandledRejection" , err => {
6+ throw err ;
7+ } ) ;
8+
9+ const client = new MongoClient ( "mongodb://localhost:7777" ) ;
10+
11+ const findHexathonUsers = async ( ) => {
12+ await client . connect ( ) ;
13+ const applicationsCollection = client . db ( "registration" ) . collection < any > ( "applications" ) ;
14+ const hexathonUsersCollection = client . db ( "hexathons" ) . collection < any > ( "hexathonusers" ) ;
15+
16+ const user = await hexathonUsersCollection . findOne ( {
17+ hexathon : new ObjectId ( "683f9a9ab75ad31cd0f2ec67" ) ,
18+ } ) ;
19+
20+ // print the user
21+ console . log ( user ) ;
22+ } ;
23+
24+ ( async ( ) => {
25+ await findHexathonUsers ( ) ;
26+
27+ console . info ( "\nDone." ) ;
28+ } ) ( ) ;
Original file line number Diff line number Diff line change @@ -528,6 +528,20 @@ applicationRouter.route("/:id/actions/submit-application").post(
528528 } ,
529529 { new : true }
530530 ) ;
531+ if (
532+ existingApplication . applicationBranch . applicationGroup ===
533+ ApplicationGroupType . PARTICIPANT
534+ ) {
535+ await apiCall (
536+ Service . HEXATHONS ,
537+ {
538+ method : "POST" ,
539+ url : `/hexathon-users/${ existingApplication . hexathon } /users/${ existingApplication . userId } /actions/check-valid-user` ,
540+ } ,
541+ req
542+ ) ;
543+ }
544+
531545 break ;
532546 // no default
533547 }
You can’t perform that action at this time.
0 commit comments