handle returned post from create post endpoint
This commit is contained in:
parent
83835d374b
commit
dab626f227
2 changed files with 3 additions and 6 deletions
|
@ -9,7 +9,7 @@ export class PostsService {
|
|||
content: string,
|
||||
media: CreatePostMedia[],
|
||||
isPublic: boolean,
|
||||
): Promise<string> {
|
||||
): Promise<Post> {
|
||||
const response = await this.client.POST('/posts', {
|
||||
body: {
|
||||
authorId,
|
||||
|
@ -26,7 +26,7 @@ export class PostsService {
|
|||
throw new Error('Failed to create post')
|
||||
}
|
||||
|
||||
return response.data.postId
|
||||
return Post.fromDto(response.data.post)
|
||||
}
|
||||
|
||||
async loadPublicFeed(cursor: string | null, amount: number | null): Promise<Post[]> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue