no message
This commit is contained in:
parent
b93fb6c1e5
commit
6bca6c5ba5
3 changed files with 40 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue