Update api definitions

This commit is contained in:
syuilo
2018-07-17 04:36:44 +09:00
parent aacfb5e221
commit 16726789da
66 changed files with 586 additions and 156 deletions

View File

@ -6,12 +6,15 @@ import { ILocalUser } from '../../../../../models/user';
import getParams from '../../../get-params';
export const meta = {
name: 'notes/reactions/create',
desc: {
ja: '投稿にリアクションします。'
ja: '指定した投稿にリアクションします。',
en: 'React to a note.'
},
requireCredential: true,
kind: 'reaction-write',
params: {
noteId: $.type(ID).note({
desc: {
@ -27,9 +30,6 @@ export const meta = {
}
};
/**
* React to a note
*/
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
const [ps, psErr] = getParams(meta, params);
if (psErr) return rej(psErr);

View File

@ -3,9 +3,17 @@ import Reaction from '../../../../../models/note-reaction';
import Note from '../../../../../models/note';
import { ILocalUser } from '../../../../../models/user';
/**
* Unreact to a note
*/
export const meta = {
desc: {
ja: '指定した投稿へのリアクションを取り消します。',
en: 'Unreact to a note.'
},
requireCredential: true,
kind: 'reaction-write'
};
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
// Get 'noteId' parameter
const [noteId, noteIdErr] = $.type(ID).get(params.noteId);