fix(backend): typo in groups resolver (#8318)

* fix typo

* fixed all related typos in unittests and found another in groups

---------

Co-authored-by: mahula <lenzmath@posteo.de>
This commit is contained in:
Ulf Gebhardt 2025-04-04 00:01:10 +02:00 committed by GitHub
parent ddd46e8304
commit 5462a5b4c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View File

@ -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!')
})
})
})

View File

@ -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!')