rename: serial -> sequential
This commit is contained in:
@@ -24,7 +24,7 @@ import { columns } from "../model/posting-table-columns";
|
||||
import { BannerApi } from "../api/banner-service";
|
||||
import { BannerForm } from "./banner-form";
|
||||
|
||||
function ModifyPage({ serial }: { serial: string }) {
|
||||
function ModifyPage({ sequential }: { sequential: string }) {
|
||||
const router = useRouter();
|
||||
const { confirm } = useConfirm();
|
||||
const queryClient = useQueryClient();
|
||||
@@ -34,24 +34,26 @@ function ModifyPage({ serial }: { serial: string }) {
|
||||
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
||||
|
||||
const { data: bannerDetail } = useQuery({
|
||||
queryKey: [ENDPOINT.CMS_SERVICE.BANNERS, serial],
|
||||
queryFn: () => BannerApi.getBannerInfo(serial),
|
||||
queryKey: [ENDPOINT.CMS_SERVICE.BANNERS, sequential],
|
||||
queryFn: () => BannerApi.getBannerInfo(sequential),
|
||||
});
|
||||
|
||||
const { data: postHistory } = useQuery({
|
||||
queryKey: [ENDPOINT.CMS_SERVICE.POSTINGS, serial],
|
||||
queryFn: () => PostingApi.getPostingHistory({ pstgTrgtNo: Number(serial) }),
|
||||
queryKey: [ENDPOINT.CMS_SERVICE.POSTINGS, sequential],
|
||||
queryFn: () =>
|
||||
PostingApi.getPostingHistory({ pstgTrgtNo: Number(sequential) }),
|
||||
});
|
||||
|
||||
const { mutateAsync: updateBanner } = useMutation({
|
||||
mutationFn: (data: BannerFormData) => BannerApi.updateBanner(serial, data),
|
||||
mutationFn: (data: BannerFormData) =>
|
||||
BannerApi.updateBanner(sequential, data),
|
||||
onSuccess: () => {
|
||||
alert("수정되었습니다.");
|
||||
},
|
||||
});
|
||||
|
||||
const { mutateAsync: deleteBanner } = useMutation({
|
||||
mutationFn: () => BannerApi.deleteBanner(serial),
|
||||
mutationFn: () => BannerApi.deleteBanner(sequential),
|
||||
onSuccess: () => {
|
||||
alert("삭제되었습니다.", router.back);
|
||||
},
|
||||
@@ -61,7 +63,7 @@ function ModifyPage({ serial }: { serial: string }) {
|
||||
mutationFn: (data: WithModePost[]) => PostingApi.requestPosting(data),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [ENDPOINT.CMS_SERVICE.POSTINGS, serial],
|
||||
queryKey: [ENDPOINT.CMS_SERVICE.POSTINGS, sequential],
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -106,7 +108,7 @@ function ModifyPage({ serial }: { serial: string }) {
|
||||
</div>
|
||||
<BannerForm
|
||||
form={form}
|
||||
bnrSn={serial}
|
||||
bnrSn={sequential}
|
||||
handleSave={updateBanner}
|
||||
handleDelete={deleteBanner}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user