mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
feat: implement media cleanup on entity deletion and enhance Dropzone logging
Added functionality to clean up media files associated with entities upon deletion, ensuring proper resource management. Enhanced logging in the Dropzone component to provide better feedback on file type validation and user interactions, improving overall user experience.
This commit is contained in:
@@ -173,9 +173,14 @@ export function Dropzone({
|
||||
|
||||
return specs.every((spec) => {
|
||||
if (spec.kind !== "file") {
|
||||
console.log("not a file", spec.kind);
|
||||
return false;
|
||||
}
|
||||
return !(allowedMimeTypes && !allowedMimeTypes.includes(spec.type));
|
||||
if (allowedMimeTypes && allowedMimeTypes.length > 0) {
|
||||
console.log("not allowed mimetype", spec.type);
|
||||
return allowedMimeTypes.includes(spec.type);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -432,6 +437,7 @@ export function Dropzone({
|
||||
type: "file",
|
||||
multiple: !maxItems || maxItems > 1,
|
||||
onChange: handleFileInputChange,
|
||||
accept: allowedMimeTypes?.join(","),
|
||||
},
|
||||
showPlaceholder,
|
||||
actions: {
|
||||
|
||||
@@ -67,7 +67,7 @@ export const DropzoneInner = ({
|
||||
)}
|
||||
>
|
||||
<div className="hidden">
|
||||
<input {...inputProps} accept={allowedMimeTypes?.join(",")} />
|
||||
<input {...inputProps} />
|
||||
</div>
|
||||
<div className="flex flex-1 flex-col">
|
||||
<div className="flex flex-row flex-wrap gap-2 md:gap-3">
|
||||
|
||||
Reference in New Issue
Block a user