feat: add recursive remove directory option

This commit is contained in:
2024-08-21 07:34:10 +07:00
parent 7532c6330c
commit 145bf3f1a9
3 changed files with 66 additions and 6 deletions
@@ -34,8 +34,17 @@ const ObjectActions = ({ prefix = "", object, end }: Props) => {
};
const onDelete = () => {
if (window.confirm("Are you sure you want to delete this object?")) {
deleteObject.mutate(prefix + object.objectKey);
if (
window.confirm(
`Are you sure you want to delete this ${
isDirectory ? "directory and its content" : "object"
}?`
)
) {
deleteObject.mutate({
key: prefix + object.objectKey,
recursive: isDirectory,
});
}
};