refactor: adjust image upload
These fields are required but is not strictly validate at api level. API will return presigned url so that client can upload file to storage.
This commit is contained in:
parent
dedeecd6fa
commit
06fa3ab9ac
3 changed files with 24 additions and 22 deletions
|
|
@ -50,7 +50,7 @@ const useBranchContactStore = defineStore('api-branch-contact', () => {
|
|||
async function create(
|
||||
branchId: string,
|
||||
data: BranchContactCreate,
|
||||
qrCodeImage: File,
|
||||
qrCodeImage?: File | null, // required but not strict
|
||||
flow?: {
|
||||
sessionId: string;
|
||||
refTransactionId: string;
|
||||
|
|
@ -69,12 +69,13 @@ const useBranchContactStore = defineStore('api-branch-contact', () => {
|
|||
},
|
||||
});
|
||||
|
||||
await axios
|
||||
.put(res.data.qrCodeImageUploadUrl, qrCodeImage, {
|
||||
headers: { 'Content-Type': qrCodeImage.type },
|
||||
onUploadProgress: (e) => console.log(e),
|
||||
})
|
||||
.catch((e) => console.error(e));
|
||||
qrCodeImage &&
|
||||
(await axios
|
||||
.put(res.data.qrCodeImageUploadUrl, qrCodeImage, {
|
||||
headers: { 'Content-Type': qrCodeImage.type },
|
||||
onUploadProgress: (e) => console.log(e),
|
||||
})
|
||||
.catch((e) => console.error(e)));
|
||||
|
||||
if (!res) return false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue