From 0463c6bb0f8fd32740ceb61ccce04c662272a618 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 23 Apr 2019 22:35:26 +0900 Subject: Refactor API (#4770) * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update description.ts * wip --- src/server/api/endpoints/app/create.ts | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'src/server/api/endpoints/app/create.ts') diff --git a/src/server/api/endpoints/app/create.ts b/src/server/api/endpoints/app/create.ts index 9db60d2661..833d5060c5 100644 --- a/src/server/api/endpoints/app/create.ts +++ b/src/server/api/endpoints/app/create.ts @@ -4,12 +4,13 @@ import define from '../../define'; import { Apps } from '../../../../models'; import { genId } from '../../../../misc/gen-id'; import { unique } from '../../../../prelude/array'; +import { types, bool } from '../../../../misc/schema'; export const meta = { tags: ['app'], requireCredential: false, - + desc: { 'ja-JP': 'アプリを作成します。', 'en-US': 'Create a application.' @@ -50,29 +51,12 @@ export const meta = { } }, }, - + res: { - type: 'object', - properties: { - id: { - type: 'string', - description: 'アプリケーションのID' - }, - name: { - type: 'string', - description: 'アプリケーションの名前' - }, - callbackUrl: { - type: 'string', - nullable: true, - description: 'コールバックするURL' - }, - secret: { - type: 'string', - description: 'アプリケーションのシークレットキー' - } - } - } + type: types.object, + optional: bool.false, nullable: bool.false, + ref: 'App', + }, }; export default define(meta, async (ps, user) => { -- cgit v1.2.3-freya