no message

This commit is contained in:
Kittapath 2024-02-28 14:18:07 +07:00
parent 4d24a34674
commit 6ed7265094
2 changed files with 56 additions and 31 deletions

View file

@ -17,7 +17,7 @@ class CallAPI {
//Get
public async GetData(request: any, @Path() path: any) {
const token = request.headers.authorization;
const url = process.env.ORG_API + path;
const url = process.env.API + path;
try {
const response = await axios.get(url, {
headers: {
@ -33,8 +33,11 @@ class CallAPI {
//Post
public async PostData(request: any, @Path() path: any, sendData: any) {
const token = request.headers.authorization;
const url = process.env.ORG_API + path;
const url = process.env.API + path;
try {
console.log("response");
console.log(url);
console.log("response");
const response = await axios.post(url, {
headers: {
Authorization: `Bearer ${token}`,
@ -42,6 +45,7 @@ class CallAPI {
},
json: sendData,
});
console.log(response);
return response.data.result;
} catch (error) {
throw error;