step 2 : try build
This commit is contained in:
30
build/lib_order.js
Normal file
30
build/lib_order.js
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.get_order = void 0;
|
||||
const axios_1 = __importDefault(require("axios"));
|
||||
const config_1 = __importDefault(require("./config/config"));
|
||||
const logging_1 = __importDefault(require("./config/logging"));
|
||||
const server_1 = require("./server");
|
||||
const get_order = async (row_per_batch) => {
|
||||
const url_patient = config_1.default.base_url + "/etl/getorder/getdata?limit=" + row_per_batch;
|
||||
logging_1.default.info(server_1.NAME_SPACE, "Info : " + url_patient);
|
||||
try {
|
||||
const resp = await axios_1.default.get(url_patient, {
|
||||
responseType: "arraybuffer",
|
||||
});
|
||||
const jresp = JSON.parse(resp.data.toString());
|
||||
return jresp;
|
||||
}
|
||||
catch (e) {
|
||||
if (axios_1.default.isAxiosError(e)) {
|
||||
logging_1.default.error(server_1.NAME_SPACE, e.response?.data.toString());
|
||||
}
|
||||
else if (e instanceof Error) {
|
||||
logging_1.default.error(server_1.NAME_SPACE, e.message);
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.get_order = get_order;
|
||||
Reference in New Issue
Block a user