rename: requestPosting -> savePosting
This commit is contained in:
@@ -19,7 +19,7 @@ export class PostingApiService implements PostService {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async requestPosting(data: WithModePost[]): Promise<Post[]> {
|
||||
public async savePosting(data: WithModePost[]): Promise<Post[]> {
|
||||
const response = await client.post<Post[]>(
|
||||
`${ENDPOINT.CMS_SERVICE.POSTINGS}`,
|
||||
data,
|
||||
|
||||
@@ -46,5 +46,5 @@ export type PostingFormData = z.infer<typeof postingFormSchema>;
|
||||
|
||||
export interface PostService {
|
||||
getPostingHistory: (params: PostingParams) => Promise<PageableList<Post>>;
|
||||
requestPosting: (data: WithModePost[]) => Promise<Post[]>;
|
||||
savePosting: (data: WithModePost[]) => Promise<Post[]>;
|
||||
}
|
||||
|
||||
@@ -75,8 +75,8 @@ function PostingDialog({ postingType, postingTargets }: PostingDialogProps) {
|
||||
queryFn: () => SiteApi.getSiteList({}),
|
||||
});
|
||||
|
||||
const { mutateAsync: requestPosting } = useMutation({
|
||||
mutationFn: (data: WithModePost[]) => PostingApi.requestPosting(data),
|
||||
const { mutateAsync: savePosting } = useMutation({
|
||||
mutationFn: (data: WithModePost[]) => PostingApi.savePosting(data),
|
||||
onSuccess: () => {
|
||||
alert("저장되었습니다.");
|
||||
},
|
||||
@@ -209,7 +209,7 @@ function PostingDialog({ postingType, postingTargets }: PostingDialogProps) {
|
||||
const handleSave = async () => {
|
||||
if (await confirm("저장하시겠습니까?")) {
|
||||
const data = form.getValues("pstg");
|
||||
await requestPosting(data);
|
||||
await savePosting(data);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ function ModifyPage({ sequential }: { sequential: string }) {
|
||||
},
|
||||
});
|
||||
|
||||
const { mutateAsync: requestPosting } = useMutation({
|
||||
mutationFn: (data: WithModePost[]) => PostingApi.requestPosting(data),
|
||||
const { mutateAsync: savePosting } = useMutation({
|
||||
mutationFn: (data: WithModePost[]) => PostingApi.savePosting(data),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [ENDPOINT.CMS_SERVICE.POSTINGS, sequential],
|
||||
@@ -93,7 +93,7 @@ function ModifyPage({ sequential }: { sequential: string }) {
|
||||
setOnConfirm(true);
|
||||
if (await confirm("삭제하시겠습니까?")) {
|
||||
setOnConfirm(false);
|
||||
await requestPosting(data);
|
||||
await savePosting(data);
|
||||
alert("삭제되었습니다.");
|
||||
}
|
||||
setOnConfirm(false);
|
||||
|
||||
@@ -55,8 +55,8 @@ function ModifyPage({ sequential }: { sequential: string }) {
|
||||
},
|
||||
});
|
||||
|
||||
const { mutateAsync: requestPosting } = useMutation({
|
||||
mutationFn: (data: WithModePost[]) => PostingApi.requestPosting(data),
|
||||
const { mutateAsync: savePosting } = useMutation({
|
||||
mutationFn: (data: WithModePost[]) => PostingApi.savePosting(data),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [ENDPOINT.CMS_SERVICE.POSTINGS, sequential],
|
||||
@@ -89,7 +89,7 @@ function ModifyPage({ sequential }: { sequential: string }) {
|
||||
setOnConfirm(true);
|
||||
if (await confirm("삭제하시겠습니까?")) {
|
||||
setOnConfirm(false);
|
||||
await requestPosting(data);
|
||||
await savePosting(data);
|
||||
alert("삭제되었습니다.");
|
||||
}
|
||||
setOnConfirm(false);
|
||||
|
||||
Reference in New Issue
Block a user