Updates
This commit is contained in:
+9
-5
@@ -96,6 +96,10 @@ async function post({
|
||||
|
||||
const reqPayload = reqPayloadString;
|
||||
|
||||
const requPath = `/api/query/${
|
||||
user_id || grabedHostNames.user_id
|
||||
}/post`;
|
||||
|
||||
const httpsRequest = scheme.request(
|
||||
{
|
||||
method: "POST",
|
||||
@@ -109,7 +113,7 @@ async function post({
|
||||
},
|
||||
port,
|
||||
hostname: host,
|
||||
path: `/api/query/${user_id || grabedHostNames.user_id}/post`,
|
||||
path: requPath,
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -127,14 +131,14 @@ async function post({
|
||||
response.on("end", function () {
|
||||
try {
|
||||
resolve(JSON.parse(str));
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.log("Fetched Payload =>", str);
|
||||
} catch (/** @type {any} */ error) {
|
||||
console.log("Route ERROR:", error.message);
|
||||
|
||||
resolve({
|
||||
success: false,
|
||||
payload: null,
|
||||
error: error,
|
||||
error: error.message,
|
||||
errPayload: str,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user