- fix: Date problems... (it was a bad "copy" function, the object date was not valid...
- fix: error fetch on loading... (offline appeared)
This commit is contained in:
@@ -31,9 +31,12 @@ async function sendRequest(url: string, lang: string, mytok: string, method: str
|
||||
method: method,
|
||||
cache: 'no-cache',
|
||||
mode: 'cors',
|
||||
body: JSON.stringify(mydata),
|
||||
headers: authHeader
|
||||
}
|
||||
|
||||
if (mydata !== null)
|
||||
configInit.body = JSON.stringify(mydata)
|
||||
|
||||
}
|
||||
|
||||
const request: Promise<Response> = fetch(url, configInit)
|
||||
|
||||
@@ -107,8 +107,10 @@ export namespace ApiTool {
|
||||
return resolve({ res, body })
|
||||
})
|
||||
.catch(e => {
|
||||
UserStore.mutations.setServerCode(rescodes.ERR_GENERICO)
|
||||
return reject({ code: rescodes.ERR_GENERICO, status: res.status })
|
||||
return resolve({ res, body: {} })
|
||||
// Array not found...
|
||||
// UserStore.mutations.setServerCode(rescodes.ERR_GENERICO)
|
||||
// return reject({ code: rescodes.ERR_GENERICO, status: res.status })
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user