|
|
|
@@ -1,22 +1,21 @@ |
|
|
|
import { myPageConfig } from "@/config/mypage"; |
|
|
|
import { MyPageApiID } from "."; |
|
|
|
|
|
|
|
type MyPageApiResponse = { |
|
|
|
result: "SUCCESS" | "FAILED"; |
|
|
|
}; |
|
|
|
|
|
|
|
const config = myPageConfig(); |
|
|
|
|
|
|
|
export const getUrl = (apiId: MyPageApiID) => { |
|
|
|
return [ |
|
|
|
process.env.VAR.MYPAGE_BASE_URL ?? "", |
|
|
|
"api-from-kintone", |
|
|
|
apiId, |
|
|
|
].join("/"); |
|
|
|
return [config.BASE_URL, "api-from-kintone", apiId].join("/"); |
|
|
|
}; |
|
|
|
|
|
|
|
export const send = async (apiId: MyPageApiID, data: object) => { |
|
|
|
const url = getUrl(apiId); |
|
|
|
const sendData = { |
|
|
|
...data, |
|
|
|
token: process.env.VAR.MYPAGE_TOKEN ?? "", |
|
|
|
token: config.TOKEN ?? "", |
|
|
|
}; |
|
|
|
console.info("MyPageAPICall", url, data); |
|
|
|
|
|
|
|
|