handle returned post from create post endpoint

This commit is contained in:
john 2025-05-28 20:05:10 +02:00
parent 83835d374b
commit dab626f227
2 changed files with 3 additions and 6 deletions

View file

@ -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[]> {