fix(backend): prohibit posting whitespace-only notes
This commit is contained in:
parent
b92c9726bd
commit
d83c01af6c
|
@ -48,6 +48,11 @@ describe('api:notes/create', () => {
|
|||
expect(v({ text: await tooLong }))
|
||||
.toBe(INVALID);
|
||||
});
|
||||
|
||||
test('whitespace-only post', () => {
|
||||
expect(v({ text: ' ' }))
|
||||
.toBe(INVALID);
|
||||
});
|
||||
});
|
||||
|
||||
describe('cw', () => {
|
||||
|
|
|
@ -138,6 +138,7 @@ export const paramDef = {
|
|||
minLength: 1,
|
||||
maxLength: MAX_NOTE_TEXT_LENGTH,
|
||||
nullable: true,
|
||||
pattern: '[^\\s]+',
|
||||
},
|
||||
fileIds: {
|
||||
type: 'array',
|
||||
|
@ -195,6 +196,7 @@ export const paramDef = {
|
|||
minLength: 1,
|
||||
maxLength: MAX_NOTE_TEXT_LENGTH,
|
||||
nullable: false,
|
||||
pattern: '[^\\s]+',
|
||||
},
|
||||
},
|
||||
required: ['text'],
|
||||
|
|
Loading…
Reference in a new issue