File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
packages/integrations/gei-bookings/src/UserMutation Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -27,16 +27,15 @@ export const bookService = async (input: FieldResolveInput) =>
27
27
bookServices . filter ( ( s ) : s is WithId < ServiceModel > => typeof s !== 'string' ) ,
28
28
bookServices . filter ( ( s ) : s is string => typeof s === 'string' )
29
29
] ;
30
- bookServices . forEach ( async ( s ) => {
31
- if ( typeof s === 'string' ) {
30
+
31
+ if ( busy [ 0 ] ) {
32
32
await o ( 'Services' ) . collection . updateMany (
33
33
{ _id : { $in : bookedServices . map ( ( s : any ) => s . _id ) } } ,
34
34
{ $set : { taken : false } } ,
35
35
) ;
36
- throw new GlobalError ( `Service is already taken: ${ s } ` , import . meta. url ) ;
36
+ throw new GlobalError ( `Service is already taken: ${ busy } ` , import . meta. url ) ;
37
37
}
38
- return s . _id ;
39
- } ) ;
38
+
40
39
41
40
42
41
const book = await o ( 'Bookings' )
You can’t perform that action at this time.
0 commit comments