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