diff --git a/backend/src/schema/resolvers/groups.spec.ts b/backend/src/schema/resolvers/groups.spec.ts index f99133be1..1d66b376c 100644 --- a/backend/src/schema/resolvers/groups.spec.ts +++ b/backend/src/schema/resolvers/groups.spec.ts @@ -377,22 +377,22 @@ describe('in mode', () => { describe('not even one', () => { describe('by "categoryIds: null"', () => { - it('throws error: "Too view categories!"', async () => { + it('throws error: "Too few categories!"', async () => { const { errors } = await mutate({ mutation: createGroupMutation(), variables: { ...variables, categoryIds: null }, }) - expect(errors![0]).toHaveProperty('message', 'Too view categories!') + expect(errors![0]).toHaveProperty('message', 'Too few categories!') }) }) describe('by "categoryIds: []"', () => { - it('throws error: "Too view categories!"', async () => { + it('throws error: "Too few categories!"', async () => { const { errors } = await mutate({ mutation: createGroupMutation(), variables: { ...variables, categoryIds: [] }, }) - expect(errors![0]).toHaveProperty('message', 'Too view categories!') + expect(errors![0]).toHaveProperty('message', 'Too few categories!') }) }) }) @@ -2900,7 +2900,7 @@ describe('in mode', () => { describe('not even one', () => { describe('by "categoryIds: []"', () => { - it('throws error: "Too view categories!"', async () => { + it('throws error: "Too few categories!"', async () => { const { errors } = await mutate({ mutation: updateGroupMutation(), variables: { @@ -2908,7 +2908,7 @@ describe('in mode', () => { categoryIds: [], }, }) - expect(errors![0]).toHaveProperty('message', 'Too view categories!') + expect(errors![0]).toHaveProperty('message', 'Too few categories!') }) }) }) diff --git a/backend/src/schema/resolvers/groups.ts b/backend/src/schema/resolvers/groups.ts index cd1eb8db3..f5282a3bb 100644 --- a/backend/src/schema/resolvers/groups.ts +++ b/backend/src/schema/resolvers/groups.ts @@ -130,7 +130,7 @@ export default { delete params.categoryIds params.locationName = params.locationName === '' ? null : params.locationName if (CONFIG.CATEGORIES_ACTIVE && (!categoryIds || categoryIds.length < CATEGORIES_MIN)) { - throw new UserInputError('Too view categories!') + throw new UserInputError('Too few categories!') } if (CONFIG.CATEGORIES_ACTIVE && categoryIds && categoryIds.length > CATEGORIES_MAX) { throw new UserInputError('Too many categories!') @@ -200,7 +200,7 @@ export default { if (CONFIG.CATEGORIES_ACTIVE && categoryIds) { if (categoryIds.length < CATEGORIES_MIN) { - throw new UserInputError('Too view categories!') + throw new UserInputError('Too few categories!') } if (categoryIds.length > CATEGORIES_MAX) { throw new UserInputError('Too many categories!')