mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-26 12:30:27 +00:00
automatically detect image types and set primary photo if first
This commit is contained in:
parent
3f455cb574
commit
51e3ad11c4
4 changed files with 39 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue