mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-13 14:29:15 +00:00
fix/feat: primary photo auto set and auto-set primary photo (#651)
* fix error when item doesn't have photo attachment
* automatically detect image types and set primary photo if first
* remove charts.js from libs
Former-commit-id: 321a83b634
This commit is contained in:
parent
bd1a241be1
commit
81e76d9dd4
13 changed files with 41 additions and 424 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