mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 05:31:22 +00:00
chore: setup commerce & next config fix: replace all call to bigcommerce from aquilacms provider feat add validation to input in signup
26 lines
531 B
TypeScript
26 lines
531 B
TypeScript
import { AquilacmsConfig, getConfig } from '../api'
|
|
import { AquilacmsUser } from '../types'
|
|
|
|
async function getCustomerId({
|
|
customerToken,
|
|
config,
|
|
}: {
|
|
customerToken: string
|
|
config?: AquilacmsConfig
|
|
}): Promise<string | undefined> {
|
|
config = getConfig(config)
|
|
const data: AquilacmsUser = await config.storeApiFetch('/v2/user', {
|
|
method: 'POST',
|
|
body: JSON.stringify({
|
|
PostBody: {},
|
|
}),
|
|
headers: {
|
|
authorization: customerToken,
|
|
},
|
|
})
|
|
|
|
return data._id
|
|
}
|
|
|
|
export default getCustomerId
|