File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
apps/meteor/app/api/server/v1 Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -272,10 +272,16 @@ const rolesRoutes = API.v1
272272 async function ( ) {
273273 const { updatedSince } = this . queryParams ;
274274
275+ if ( isNaN ( Date . parse ( updatedSince ) ) ) {
276+ throw new Meteor . Error ( 'error-updatedSince-param-invalid' , 'The "updatedSince" query parameter must be a valid date.' ) ;
277+ }
278+
279+ const updatedSinceDate = new Date ( updatedSince ) ;
280+
275281 return API . v1 . success ( {
276282 roles : {
277- update : await Roles . findByUpdatedDate ( new Date ( updatedSince ) ) . toArray ( ) ,
278- remove : await Roles . trashFindDeletedAfter ( new Date ( updatedSince ) ) . toArray ( ) ,
283+ update : await Roles . findByUpdatedDate ( updatedSinceDate ) . toArray ( ) ,
284+ remove : await Roles . trashFindDeletedAfter ( updatedSinceDate ) . toArray ( ) ,
279285 } ,
280286 } ) ;
281287 } ,
You can’t perform that action at this time.
0 commit comments