mirror of
https://github.com/hpd840321/craftlabs-authorization-sdk.git
synced 2026-06-09 10:00:30 +08:00
feat(m2): add contract attachment upload and listing
This commit is contained in:
@@ -3,6 +3,18 @@ import axios from "axios";
|
||||
/**
|
||||
* @param {{ page?: number, size?: number, keyword?: string }} params
|
||||
*/
|
||||
export function uploadContractAttachment(contractId, file) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return axios.post(`/api/v1/contracts/${contractId}/attachments`, formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
});
|
||||
}
|
||||
|
||||
export function listContractAttachments(contractId) {
|
||||
return axios.get(`/api/v1/contracts/${contractId}/attachments`);
|
||||
}
|
||||
|
||||
export function listCustomers(params) {
|
||||
return axios.get("/api/v1/customers", { params });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user