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