fix(server): 単純にrenoteできないのを修正

This commit is contained in:
tamaina 2023-02-26 11:10:24 +00:00
parent a56898df94
commit 02d7ffd305
2 changed files with 16 additions and 0 deletions

View file

@ -235,6 +235,21 @@ describe('api:notes/create', () => {
}); });
}); });
describe('renote', () => {
test('just a renote', () => {
expect(v({ renoteId: '1' }))
.toBe(VALID);
});
test('just a quote', () => {
expect(v({ text: 'Hello, world!', renoteId: '1' }))
.toBe(VALID);
});
test('reject invalid renoteId', () => {
expect(v({ renoteId: 'あ' }))
.toBe(INVALID);
});
});
test('text, fileIds and poll', () => { test('text, fileIds and poll', () => {
expect(v({ text: 'Hello, world!', fileIds: ['1', '2', '3'], poll: { choices: ['a', 'b', 'c'] } })) expect(v({ text: 'Hello, world!', fileIds: ['1', '2', '3'], poll: { choices: ['a', 'b', 'c'] } }))
.toBe(VALID); .toBe(VALID);

View file

@ -147,6 +147,7 @@ export const paramDef = {
// (re)note with text, files and poll are optional // (re)note with text, files and poll are optional
anyOf: [ anyOf: [
{ required: ['text'] }, { required: ['text'] },
{ required: ['renoteId'] },
{ required: ['fileIds'] }, { required: ['fileIds'] },
{ required: ['mediaIds'] }, { required: ['mediaIds'] },
{ required: ['poll'] }, { required: ['poll'] },