diff options
Diffstat (limited to '')
| -rw-r--r-- | src/api/endpoints/posts/create.ts | 5 | ||||
| -rw-r--r-- | src/api/models/post.ts | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/api/endpoints/posts/create.ts b/src/api/endpoints/posts/create.ts index 075e1ac9f0..57f98fa811 100644 --- a/src/api/endpoints/posts/create.ts +++ b/src/api/endpoints/posts/create.ts @@ -31,6 +31,10 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => { const [text, textErr] = $(params.text).optional.string().pipe(isValidText).$; if (textErr) return rej('invalid text'); + // Get 'via_mobile' parameter + const [viaMobile = false, viaMobileErr] = $(params.via_mobile).optional.boolean().$; + if (viaMobileErr) return rej('invalid via_mobile'); + // Get 'tags' parameter const [tags = [], tagsErr] = $(params.tags).optional.array('string').unique().eachQ(t => t.range(1, 32)).$; if (tagsErr) return rej('invalid tags'); @@ -239,6 +243,7 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => { tags: tags, user_id: user._id, app_id: app ? app._id : null, + via_mobile: viaMobile, // 以下非正規化データ _reply: reply ? { user_id: reply.user_id } : undefined, diff --git a/src/api/models/post.ts b/src/api/models/post.ts index 0bbacebf66..edb69e0c15 100644 --- a/src/api/models/post.ts +++ b/src/api/models/post.ts @@ -31,6 +31,7 @@ export type IPost = { app_id: mongo.ObjectID; category: string; is_category_verified: boolean; + via_mobile: boolean; }; /** |