step 1 : setting konfigurasi

This commit is contained in:
sindhu
2024-07-25 09:45:02 +07:00
parent 9f972502d3
commit 84607a40db
1642 changed files with 1427528 additions and 0 deletions

23
source/lib_order.ts Normal file
View File

@@ -0,0 +1,23 @@
import axios from "axios";
import config from "./config/config";
import logging from "./config/logging";
import { NAME_SPACE } from "./server";
export const get_order = async (row_per_batch: number) => {
const url_patient =
config.base_url + "/etl/getorder/getdata?limit=" + row_per_batch;
logging.info(NAME_SPACE, "Info : " + url_patient);
try {
const resp = await axios.get(url_patient, {
responseType: "arraybuffer",
});
const jresp = JSON.parse(resp.data.toString());
return jresp;
} catch (e) {
if (axios.isAxiosError(e)) {
logging.error(NAME_SPACE, e.response?.data.toString());
} else if (e instanceof Error) {
logging.error(NAME_SPACE, e.message);
}
}
};