mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-01-19 22:03:59 +01:00
fix(backend): text: null
だけのノートは投稿できないように
This commit is contained in:
parent
762fa6a8d8
commit
e537f9120c
1 changed files with 26 additions and 7 deletions
|
@ -172,13 +172,32 @@ export const paramDef = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// (re)note with text, files and poll are optional
|
// (re)note with text, files and poll are optional
|
||||||
anyOf: [
|
if: {
|
||||||
{ required: ['text'] },
|
properties: {
|
||||||
{ required: ['renoteId'] },
|
renoteId: {
|
||||||
{ required: ['fileIds'] },
|
type: 'null',
|
||||||
{ required: ['mediaIds'] },
|
},
|
||||||
{ required: ['poll'] },
|
fileIds: {
|
||||||
],
|
type: 'null',
|
||||||
|
},
|
||||||
|
mediaIds: {
|
||||||
|
type: 'null',
|
||||||
|
},
|
||||||
|
poll: {
|
||||||
|
type: 'null',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
then: {
|
||||||
|
properties: {
|
||||||
|
text: {
|
||||||
|
type: 'string',
|
||||||
|
minLength: 1,
|
||||||
|
maxLength: MAX_NOTE_TEXT_LENGTH,
|
||||||
|
nullable: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|
Loading…
Reference in a new issue