mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-17 21:25:54 +02:00
fix: quick send not working
This commit is contained in:
@@ -68,10 +68,14 @@ function GenerateToken() {
|
||||
}));
|
||||
SetApiToken(res?.data?.result?.result);
|
||||
}
|
||||
const body = { email: Parse?.User?.current()?.getEmail() || "" };
|
||||
const testurl = "https://sandbox.opensignlabs.com/api/gettesttoken";
|
||||
const testRes = await axios.post(testurl, body);
|
||||
setApiTestToken(testRes.data?.token);
|
||||
try {
|
||||
const body = { email: Parse?.User?.current()?.getEmail() || "" };
|
||||
const testurl = "https://sandbox.opensignlabs.com/api/gettesttoken";
|
||||
const testRes = await axios.post(testurl, body);
|
||||
setApiTestToken(testRes.data?.token);
|
||||
} catch (err) {
|
||||
console.log("err in fetch test token", err);
|
||||
}
|
||||
} catch (err) {
|
||||
SetApiToken();
|
||||
console.log("Err", err);
|
||||
|
||||
@@ -217,7 +217,7 @@ export default async function createBatchDocs(request) {
|
||||
const allowedCredits = _resSub?.AllowedCredits || 0;
|
||||
const addonCredits = _resSub?.AddonCredits || 0;
|
||||
const totalcredits = allowedCredits + addonCredits;
|
||||
if (docsCount <= totalcredits) {
|
||||
if (requests?.length <= totalcredits) {
|
||||
const response = await axios.post('batch', { requests: requests }, parseConfig);
|
||||
// // Handle the batch query response
|
||||
// console.log('Batch query response:', response.data);
|
||||
@@ -257,11 +257,11 @@ export default async function createBatchDocs(request) {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
const code = err?.response?.data?.code || err?.response?.status || err?.code || 400;
|
||||
const code = error?.response?.data?.code || error?.response?.status || error?.code || 400;
|
||||
const msg =
|
||||
err?.response?.data?.error ||
|
||||
err?.response?.data ||
|
||||
err?.message ||
|
||||
error?.response?.data?.error ||
|
||||
error?.response?.data ||
|
||||
error?.message ||
|
||||
'Something went wrong.';
|
||||
console.log('Error performing batch query:', code, msg);
|
||||
throw new Parse.Error(code, msg);
|
||||
|
||||
Reference in New Issue
Block a user