Create file constant
This commit is contained in:
@@ -10,6 +10,7 @@ import Button from '@/components/button/PrimaryButton'
|
||||
import { extractErrorMessage } from '@/lib/func'
|
||||
import { useReceiptStore } from '@/zustand/receiptStore'
|
||||
import { useBulkCart } from '@/app/[name]/(Dialogs)/cart/hooks/useCartData'
|
||||
import { setRefreshToken, setToken } from '@/lib/api/func'
|
||||
|
||||
|
||||
type Props = {
|
||||
@@ -38,8 +39,8 @@ const StepOtp = ({ phone, slug }: Props) => {
|
||||
mutateOtpVerify(values, {
|
||||
onSuccess: (data) => {
|
||||
toast(t('otp_verified'), 'success')
|
||||
localStorage.setItem(process.env.NEXT_PUBLIC_TOKEN_NAME as string, data?.data?.tokens?.accessToken?.token as string)
|
||||
localStorage.setItem(process.env.NEXT_PUBLIC_REFRESH_TOKEN_NAME as string, data?.data?.tokens?.refreshToken?.token as string)
|
||||
setToken(data?.data?.tokens?.accessToken?.token as string)
|
||||
setRefreshToken(data?.data?.tokens?.refreshToken?.token as string)
|
||||
|
||||
if (Object.keys(items).length > 0) {
|
||||
const bulkCartItems = Object.entries(items).map(([key, value]) => {
|
||||
|
||||
Reference in New Issue
Block a user