mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 17:38:10 +00:00
call tauri delete instead
This commit is contained in:
1 parent
2937daef92
commit
a32eb6c64b
4 files changed
+17
-6
No files matched your search
@@ -16,6 +16,7 @@ import {
|
||||
isActionReminderOpen,
|
||||
} from "@storyteller/ui-action-reminder-modal";
|
||||
import { MediaFilesApi } from "@storyteller/api";
|
||||
import { MediaFileDelete } from "@storyteller/tauri-api";
|
||||
|
||||
type ModalMode = "select" | "view";
|
||||
|
||||
@@ -62,13 +63,16 @@ export const GalleryDraggableItem: React.FC<GalleryDraggableItemProps> = ({
|
||||
secondaryActionText: "Cancel",
|
||||
primaryActionBtnClassName: "bg-red text-white hover:bg-red/90",
|
||||
onPrimaryAction: async () => {
|
||||
console.log(">>> Delete media file via Tauri: ", item.id);
|
||||
try {
|
||||
const res = await mediaFilesApi.DeleteMediaFileByToken({
|
||||
mediaFileToken: item.id,
|
||||
});
|
||||
if (res.success) {
|
||||
onDeleted?.(item.id);
|
||||
}
|
||||
await MediaFileDelete(item.id);
|
||||
onDeleted?.(item.id);
|
||||
//const res = await mediaFilesApi.DeleteMediaFileByToken({
|
||||
// mediaFileToken: item.id,
|
||||
//});
|
||||
//if (res.success) {
|
||||
// onDeleted?.(item.id);
|
||||
//}
|
||||
} finally {
|
||||
isActionReminderOpen.value = false;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
{
|
||||
"path": "../../api"
|
||||
},
|
||||
{
|
||||
"path": "../../tauri-api"
|
||||
},
|
||||
{
|
||||
"path": "../action-reminder-modal"
|
||||
},
|
||||
|
||||
@@ -64,6 +64,9 @@
|
||||
{
|
||||
"path": "../../api/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../tauri-api/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../action-reminder-modal/tsconfig.lib.json"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export * from "./lib/artcraft/ArtcraftGetCredits.js";
|
||||
export * from "./lib/artcraft/ArtcraftGetSubscription.js";
|
||||
export * from "./lib/artcraft/media_files/MediaFileDelete.js";
|
||||
export * from "./lib/common/CommandStatus.js";
|
||||
export * from "./lib/enqueue/EnqueueContextualEditImage.js";
|
||||
export * from "./lib/enqueue/EnqueueImageBgRemovalCommand.js";
|
||||
|
||||
Reference in new issue
Block a user