feat: set image separate from update endpoints
This commit is contained in:
parent
68838cec60
commit
d9f6e1423a
1 changed files with 8 additions and 0 deletions
|
|
@ -20,6 +20,13 @@ const useCustomerStore = defineStore('api-customer', () => {
|
||||||
const flowStore = useFlowStore();
|
const flowStore = useFlowStore();
|
||||||
const data = ref<Pagination<Customer[]>>();
|
const data = ref<Pagination<Customer[]>>();
|
||||||
|
|
||||||
|
async function setImage(id: string, image: File) {
|
||||||
|
await api.put(`/customer/${id}/image`, image, {
|
||||||
|
headers: { 'Content-Type': image?.type },
|
||||||
|
onUploadProgress: (e) => console.log(e),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function fetchById(
|
async function fetchById(
|
||||||
customerId: string,
|
customerId: string,
|
||||||
flow?: {
|
flow?: {
|
||||||
|
|
@ -480,6 +487,7 @@ const useCustomerStore = defineStore('api-customer', () => {
|
||||||
|
|
||||||
getStatsCustomer,
|
getStatsCustomer,
|
||||||
|
|
||||||
|
setImage,
|
||||||
fetchListCustomeBranch,
|
fetchListCustomeBranch,
|
||||||
fetchById,
|
fetchById,
|
||||||
fetchList,
|
fetchList,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue