Skip to content

Commit 5daa717

Browse files
committed
fix: fix new multi posts always override previous post
1 parent af8ae3f commit 5daa717

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/services/blog-post.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,14 @@ export class BlogPostService {
116116
await globalState.storage.update('postsListState', finalState);
117117
}
118118

119-
async fetchPostEditDtoTemplate() {
119+
async fetchPostEditDtoTemplate(): Promise<PostEditDto> {
120120
if (!newPostTemplate) {
121121
newPostTemplate = await this.fetchPostEditDto(-1);
122122
}
123123

124-
return newPostTemplate;
124+
return Object.assign({}, newPostTemplate, {
125+
post: Object.assign({}, newPostTemplate.post),
126+
} as PostEditDto);
125127
}
126128
}
127129

0 commit comments

Comments
 (0)