rename: serial -> sequential
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { ModifyPage as VModifyPage } from "@/pages/banner";
|
||||
|
||||
export default async function ModifyPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ sequential: string }>;
|
||||
}) {
|
||||
const { sequential } = await params;
|
||||
return <VModifyPage sequential={sequential} />;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import { ModifyPage as VModifyPage } from "@/pages/banner";
|
||||
|
||||
export default async function ModifyPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ serial: string }>;
|
||||
}) {
|
||||
const { serial } = await params;
|
||||
return <VModifyPage serial={serial} />;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { ModifyPage as VModifyPage } from "@/pages/image";
|
||||
|
||||
export default async function ModifyPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ sequential: string }>;
|
||||
}) {
|
||||
const { sequential } = await params;
|
||||
return <VModifyPage sequential={sequential} />;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import { ModifyPage as VModifyPage } from "@/pages/image";
|
||||
|
||||
export default async function ModifyPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ serial: string }>;
|
||||
}) {
|
||||
const { serial } = await params;
|
||||
return <VModifyPage serial={serial} />;
|
||||
}
|
||||
@@ -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}
|
||||
/>
|
||||
|
||||
@@ -21,7 +21,7 @@ import { columns } from "../model/posting-table-columns";
|
||||
import { ImageApi } from "../api/image-service";
|
||||
import { ImageForm } from "./image-form";
|
||||
|
||||
function ModifyPage({ serial }: { serial: string }) {
|
||||
function ModifyPage({ sequential }: { sequential: string }) {
|
||||
const router = useRouter();
|
||||
const { confirm } = useConfirm();
|
||||
const queryClient = useQueryClient();
|
||||
@@ -31,24 +31,25 @@ function ModifyPage({ serial }: { serial: string }) {
|
||||
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
|
||||
|
||||
const { data: imageDetail } = useQuery({
|
||||
queryKey: [ENDPOINT.CMS_SERVICE.IMAGES, serial],
|
||||
queryFn: () => ImageApi.getImageInfo(serial),
|
||||
queryKey: [ENDPOINT.CMS_SERVICE.IMAGES, sequential],
|
||||
queryFn: () => ImageApi.getImageInfo(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: updateImage } = useMutation({
|
||||
mutationFn: (data: ImageFormData) => ImageApi.updateImage(serial, data),
|
||||
mutationFn: (data: ImageFormData) => ImageApi.updateImage(sequential, data),
|
||||
onSuccess: () => {
|
||||
alert("수정되었습니다.");
|
||||
},
|
||||
});
|
||||
|
||||
const { mutateAsync: deleteImage } = useMutation({
|
||||
mutationFn: () => ImageApi.deleteImage(serial),
|
||||
mutationFn: () => ImageApi.deleteImage(sequential),
|
||||
onSuccess: () => {
|
||||
alert("삭제되었습니다.", router.back);
|
||||
},
|
||||
@@ -58,7 +59,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],
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -103,7 +104,7 @@ function ModifyPage({ serial }: { serial: string }) {
|
||||
</div>
|
||||
<ImageForm
|
||||
form={form}
|
||||
imgSn={serial}
|
||||
imgSn={sequential}
|
||||
handleSave={updateImage}
|
||||
handleDelete={deleteImage}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user