This commit is contained in:
john 2025-05-18 13:41:08 +02:00
parent abd7c2f073
commit 384da1e832
18 changed files with 150 additions and 116 deletions

View file

@ -4,7 +4,12 @@ import client from '../../api/client.ts'
export class PostsService {
constructor() {}
async createNew(authorId: string, content: string, media: CreatePostMedia[]): Promise<string> {
async createNew(
authorId: string,
content: string,
media: CreatePostMedia[],
isPublic: boolean,
): Promise<string> {
const response = await client.POST('/posts', {
body: {
authorId,
@ -12,6 +17,7 @@ export class PostsService {
media: media.map((m) => {
return { ...m, type: null, url: m.url.toString() }
}),
isPublic,
},
credentials: 'include',
})