mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
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:
parent
ddd46e8304
commit
5462a5b4c1
@ -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!')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -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!')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user