mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-01 08:18:14 +09:00
parent
2b4d63b1bb
commit
6951f7e74a
@ -219,7 +219,7 @@ export default define(meta, (ps, user, app) => new Promise(async (res, rej) => {
|
||||
}
|
||||
|
||||
// テキストが無いかつ添付ファイルが無いかつRenoteも無いかつ投票も無かったらエラー
|
||||
if ((ps.text == null) && files === null && renote === null && ps.poll == null) {
|
||||
if (!(ps.text || files.length || renote || ps.poll)) {
|
||||
return rej('text, fileIds, renoteId or poll is required');
|
||||
}
|
||||
|
||||
|
@ -314,6 +314,7 @@ describe('API', () => {
|
||||
const file = await uploadFile(bob);
|
||||
|
||||
const res = await request('/notes/create', {
|
||||
text: 'test',
|
||||
fileIds: [file.id]
|
||||
}, me);
|
||||
|
||||
@ -327,6 +328,7 @@ describe('API', () => {
|
||||
const me = await signup();
|
||||
|
||||
const res = await request('/notes/create', {
|
||||
text: 'test',
|
||||
fileIds: ['000000000000000000000000']
|
||||
}, me);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user