From fc15249aa43471e73eb9dda46e1807084f4d2cd3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 5 Apr 2018 15:50:52 +0900 Subject: [PATCH] wip --- src/api/post/create.ts | 11 +++++++---- src/client/app/init.ts | 6 +----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/api/post/create.ts b/src/api/post/create.ts index 36819ec2b..549511753 100644 --- a/src/api/post/create.ts +++ b/src/api/post/create.ts @@ -54,8 +54,7 @@ export default async (user: IUser, content: { }); } - // 投稿を作成 - const post = await Post.insert({ + const data: any = { createdAt: content.createdAt, mediaIds: content.media ? content.media.map(file => file._id) : [], replyId: content.reply ? content.reply._id : null, @@ -68,14 +67,18 @@ export default async (user: IUser, content: { userId: user._id, viaMobile: content.viaMobile, geo: content.geo || null, - uri: content.uri, appId: content.app ? content.app._id : null, visibility: content.visibility, // 以下非正規化データ _reply: content.reply ? { userId: content.reply.userId } : null, _repost: content.repost ? { userId: content.repost.userId } : null, - }); + }; + + if (content.uri != null) data.uri = content.uri; + + // 投稿を作成 + const post = await Post.insert(data); res(post); diff --git a/src/client/app/init.ts b/src/client/app/init.ts index 3e5c38961..2fb8f15cf 100644 --- a/src/client/app/init.ts +++ b/src/client/app/init.ts @@ -14,7 +14,7 @@ import ElementLocaleJa from 'element-ui/lib/locale/lang/ja'; import App from './app.vue'; import checkForUpdate from './common/scripts/check-for-update'; import MiOS, { API } from './common/mios'; -import { version, codename, hostname, lang } from './config'; +import { version, codename, lang } from './config'; let elementLocale; switch (lang) { @@ -60,10 +60,6 @@ console.info( window.clearTimeout((window as any).mkBootTimer); delete (window as any).mkBootTimer; -if (hostname != 'localhost') { - document.domain = hostname; -} - //#region Set lang attr const html = document.documentElement; html.setAttribute('lang', lang);