fix(fetch): fix
This commit is contained in:
@@ -61,21 +61,24 @@ export async function POST(req: any) {
|
||||
method,
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
["Token"]: userData?.refresh_token,
|
||||
["Refresh-Token"]: userData?.refresh_token,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: userData?.refresh_token,
|
||||
}),
|
||||
// body: JSON.stringify({
|
||||
// token: userData?.refresh_token,
|
||||
// }),
|
||||
}
|
||||
} else {
|
||||
const authorization = `bearer ${userData?.access_token}`
|
||||
const access_token = `${userData?.access_token}`
|
||||
fetchOptions = {
|
||||
method,
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
authorization: authorization,
|
||||
["Token"]: access_token,
|
||||
["Refresh-Token"]: userData?.refresh_token,
|
||||
},
|
||||
}
|
||||
if (method === "POST" || method === "PUT") {
|
||||
if (method === "POST" || method === "PUT" || method === "DELETE") {
|
||||
fetchOptions.body = data
|
||||
} else {
|
||||
if (isParamsValid(data)) {
|
||||
|
||||
Reference in New Issue
Block a user