summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-05 18:43:06 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-05 18:43:06 +0900
commit7403f38fb43b0ad747236061a591cbf94e198ba6 (patch)
treebcfb900e3b9b19fb5ce7928a5f075b5d16b02e1e /src/api
parentwip (diff)
downloadmisskey-7403f38fb43b0ad747236061a591cbf94e198ba6.tar.gz
misskey-7403f38fb43b0ad747236061a591cbf94e198ba6.tar.bz2
misskey-7403f38fb43b0ad747236061a591cbf94e198ba6.zip
wip
Diffstat (limited to 'src/api')
-rw-r--r--src/api/post/create.ts15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/api/post/create.ts b/src/api/post/create.ts
index 5495117538..dbeb87ae86 100644
--- a/src/api/post/create.ts
+++ b/src/api/post/create.ts
@@ -18,20 +18,21 @@ import html from '../../text/html';
import { IApp } from '../../models/app';
export default async (user: IUser, content: {
- createdAt: Date;
- text: string;
- reply: IPost;
- repost: IPost;
- media: IDriveFile[];
- geo: any;
+ createdAt?: Date;
+ text?: string;
+ reply?: IPost;
+ repost?: IPost;
+ media?: IDriveFile[];
+ geo?: any;
poll?: any;
- viaMobile: boolean;
+ viaMobile?: boolean;
tags?: string[];
cw?: string;
visibility?: string;
uri?: string;
app?: IApp;
}) => new Promise<IPost>(async (res, rej) => {
+ if (content.createdAt == null) content.createdAt = new Date();
if (content.visibility == null) content.visibility = 'public';
const tags = content.tags || [];