method: 'DELETE',
})
}
+
+export const reactPostApi = async (idPost: string): Promise> => {
+ return $api(`/posts/${idPost}/reacts`, {
+ method: 'POST',
+ })
+}
+
+export const commentPostApi = async (idPost: string, data: any): Promise> => {
+ return $api(`/posts/${idPost}/comments`, {
+ method: 'POST',
+ body: data,
+ })
+}
diff --git a/src/services/user.ts b/src/services/user.ts
index 23b6d4e..bd251db 100644
--- a/src/services/user.ts
+++ b/src/services/user.ts
@@ -11,11 +11,11 @@ export const getInfoApi = async (): Promise> => {
})
}
-export const getUserApi = async (id: string): Promise> => {
- return $api(`/users/profiles`, {
+export const getUserApi = async (id: string): Promise> => {
+ return $api(`/users`, {
method: 'GET',
query: {
- ids: id,
+ userId: id,
},
})
}
diff --git a/src/types/group.ts b/src/types/group.ts
index 69e27a4..c72c146 100644
--- a/src/types/group.ts
+++ b/src/types/group.ts
@@ -36,8 +36,35 @@ export interface IPost {
member_id: string
type: string
content: string
- quizzfly_id: string
- files: Array
+ files: [
+ {
+ url: string
+ bytes: number
+ format: string
+ public_id: string
+ resource_type: string
+ original_filename: string
+ },
+ ]
+ quizzfly: IQuizzfly
+ react_count: number
+ comment_count: number
+ member: {
+ id: string
+ username: string
+ name: string
+ avatar: string
+ }
+}
+
+export interface IQuizzfly {
+ id: string
+ title: string
+ description: string
+ cover_image: string
+ theme: string
+ is_public: boolean
+ quizzfly_status: string
}
export interface ICreatePost {