diff --git a/src/api/qr-service.ts b/src/api/qr-service.ts index e3728b5..5a630da 100644 --- a/src/api/qr-service.ts +++ b/src/api/qr-service.ts @@ -11,6 +11,7 @@ export type QRサービス券駐車場グループ = { // -------QRサービス券取得--------------- export type QRサービス券取得Request = { + customer_id: string; token: string; ticket_id?: string; }; @@ -108,6 +109,7 @@ export type QRサービス券取得用トークン取得Request = {}; export type QRサービス券取得用トークン取得Response = { data: { token: string; + customer_id: number; }; } & APICommonResponse; export const QRサービス券取得用トークン取得 = async ( diff --git a/src/pages/dashboard/qr-service/サービス券発行/index.tsx b/src/pages/dashboard/qr-service/サービス券発行/index.tsx index 9f147b0..2c8cccb 100644 --- a/src/pages/dashboard/qr-service/サービス券発行/index.tsx +++ b/src/pages/dashboard/qr-service/サービス券発行/index.tsx @@ -24,6 +24,7 @@ export default function Main() { const { error } = useSnackbarCustom(); const [token, setToken] = useState(""); + const [customerId, setCustomerId] = useState(0); const [qr, setQr] = useState(""); const { callAPI: callQRサービス券取得用トークン取得 } = useAPICall({ @@ -31,6 +32,7 @@ export default function Main() { backDrop: true, onSuccess: ({ data }) => { setToken(data.token); + setCustomerId(data.customer_id); }, onFailed: () => { error("QR表示失敗しました"); @@ -42,9 +44,10 @@ export default function Main() { return getFullPath(PageID.QRサービス券発行申請, { query: { token, + customerId: String(customerId), }, }); - }, [token]); + }, [token, customerId]); const fetch = () => { callQRサービス券取得用トークン取得({}); diff --git a/src/pages/qr-service/QRサービス券発行申請.tsx b/src/pages/qr-service/QRサービス券発行申請.tsx index 0540995..2f5c6a4 100644 --- a/src/pages/qr-service/QRサービス券発行申請.tsx +++ b/src/pages/qr-service/QRサービス券発行申請.tsx @@ -9,7 +9,7 @@ import { StoreId, getStore, setStore } from "storage/localstorage"; const size = 200; export default function QRサービス券発行申請() { - const { token: paramToken } = useParams(); + const { token: paramToken, customerId: paramCustomerId } = useParams(); const [failed, setFailed] = useState(undefined); const [qrStr, setQrStr] = useState(""); @@ -31,6 +31,7 @@ export default function QRサービス券発行申請() { const handleClick = () => { const param: QRサービス券取得Request = { token: paramToken ?? "noparam", + customer_id: paramCustomerId ?? "noparam", }; const ticketId = getStore(StoreId.QRサービス券チケットID); if (ticketId) { diff --git a/src/routes/path.ts b/src/routes/path.ts index 5b5a2bc..0703852 100644 --- a/src/routes/path.ts +++ b/src/routes/path.ts @@ -80,7 +80,8 @@ const PATHS = { [makePathKey(PageID.LOGOUT)]: "/logout", [makePathKey(PageID.成り代わり終了)]: "/role/switch/end", - [makePathKey(PageID.QRサービス券発行申請)]: "/qr-service/acquisition/:token", + [makePathKey(PageID.QRサービス券発行申請)]: + "/qr-service/acquisition/:customerId/:token", [makePathKey(PageID.QRサービス券承認)]: "/qr-service/certificate/:data", // ダッシュボード----------------