From a1d9951d5c8747e9891830d019ed835a62b6b138 Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Tue, 9 Apr 2024 13:06:16 +0900 Subject: [PATCH] =?UTF-8?q?QR=E3=82=B5=E3=83=BC=E3=83=93=E3=82=B9=E5=88=B8?= =?UTF-8?q?=E5=8F=96=E5=BE=97=E6=99=82=E3=81=AB=E9=A1=A7=E5=AE=A2ID?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qr-service.ts | 2 ++ .../dashboard/qr-service/サービス券発行/index.tsx | 5 ++++- src/pages/qr-service/QRサービス券発行申請.tsx | 3 ++- src/routes/path.ts | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) 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", // ダッシュボード----------------