Skip to content

Commit

Permalink
refactor: PUT post/v2
Browse files Browse the repository at this point in the history
  • Loading branch information
j-nary committed Oct 30, 2024
1 parent 71ac556 commit cfb2a4c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/api/post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ export const createPost = async (formData: FormCreateType) => {
};

export const editPost = async (postId: string, formData: FormEditType) => {
const { data } = await api.put<Data<Pick<PostResponse, 'id' | 'title' | 'contents' | 'updatedDate' | 'images'>>>(
`/post/v1/${postId}`,
formData
);
type editPostType =
paths['/post/v2/{postId}']['put']['responses']['200']['content']['application/json;charset=UTF-8'];
const { data } = await api.put<editPostType>(`/post/v2/${postId}`, formData);
return data;
};

Expand Down

0 comments on commit cfb2a4c

Please sign in to comment.