Fix message not being added to the database when it fails (#6043)
This commit is contained in:
parent
2645f7e66e
commit
5a0a2c2220
1 changed files with 2 additions and 1 deletions
|
|
@ -53,7 +53,7 @@ export const createPost = async (serverUrl: string, post: Partial<Post>, files:
|
|||
return {error};
|
||||
}
|
||||
|
||||
const currentUserId = queryCurrentUserId(operator.database);
|
||||
const currentUserId = await queryCurrentUserId(operator.database);
|
||||
const timestamp = Date.now();
|
||||
const pendingPostId = post.pending_post_id || `${currentUserId}:${timestamp}`;
|
||||
|
||||
|
|
@ -68,6 +68,7 @@ export const createPost = async (serverUrl: string, post: Partial<Post>, files:
|
|||
pending_post_id: pendingPostId,
|
||||
create_at: timestamp,
|
||||
update_at: timestamp,
|
||||
delete_at: 0,
|
||||
} as Post;
|
||||
|
||||
if (files.length) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue