Skip to content

Commit 15e4f11

Browse files
committed
fix: wrong validation on parseJsonQuery
1 parent 7b95565 commit 15e4f11

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

apps/meteor/app/api/server/helpers/parseJsonQuery.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,12 @@ export async function parseJsonQuery(api: GenericRouteExecutionContext): Promise
2525
*/
2626
query: Record<string, unknown>;
2727
}> {
28-
const { userId, response, route, logger } = api;
28+
const { userId = '', response, route, logger } = api;
2929

3030
const params = isPlainObject(api.queryParams) ? api.queryParams : {};
3131
const queryFields = Array.isArray(api.queryFields) ? (api.queryFields as string[]) : [];
3232
const queryOperations = Array.isArray(api.queryOperations) ? (api.queryOperations as string[]) : [];
3333

34-
if (!userId) {
35-
throw new Meteor.Error('error-invalid-user', 'Invalid user');
36-
}
37-
3834
let sort;
3935
if (typeof params?.sort === 'string') {
4036
try {

0 commit comments

Comments
 (0)