automatically detect image types and set primary photo if first

This commit is contained in:
Hayden 2023-12-01 11:45:20 -06:00
parent 3f455cb574
commit 51e3ad11c4
No known key found for this signature in database
GPG key ID: 17CF79474E257545
4 changed files with 39 additions and 9 deletions

View file

@ -253,7 +253,7 @@
return;
}
uploadAttachment([first], AttachmentTypes.Attachment);
uploadAttachment([first], null);
}
const dropPhoto = (files: File[] | null) => uploadAttachment(files, AttachmentTypes.Photo);
@ -262,7 +262,7 @@
const dropManual = (files: File[] | null) => uploadAttachment(files, AttachmentTypes.Manual);
const dropReceipt = (files: File[] | null) => uploadAttachment(files, AttachmentTypes.Receipt);
async function uploadAttachment(files: File[] | null, type: AttachmentTypes) {
async function uploadAttachment(files: File[] | null, type: AttachmentTypes | null) {
if (!files || files.length === 0) {
return;
}