no message

This commit is contained in:
Kittapath 2024-02-28 13:59:03 +07:00
parent b93fb6c1e5
commit 6bca6c5ba5
3 changed files with 40 additions and 1 deletions

View file

@ -30,6 +30,23 @@ class CallAPI {
throw error;
}
}
//Post
public async PostData(request: any, @Path() path: any, sendData: any) {
const token = request.headers.authorization;
const url = process.env.ORG_API + path;
try {
const response = await axios.post(url, {
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
json: sendData,
});
return response.data.result;
} catch (error) {
throw error;
}
}
}
export default CallAPI;