23 lines
673 B
TypeScript
23 lines
673 B
TypeScript
import axios from "axios";
|
|
import config from "./config/config";
|
|
import logging from "./config/logging";
|
|
import { NAME_SPACE } from "./server";
|
|
|
|
export const uploadPayment = async () => {
|
|
const url = config.base_url + "tools/member/uploadpaymentpoint/upload";
|
|
logging.info(NAME_SPACE, "INFO : " + url);
|
|
try {
|
|
const resp = await axios.get(url, {
|
|
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);
|
|
}
|
|
}
|
|
};
|