dont use [...path] routing since it breaks building statically
This commit is contained in:
@@ -9,21 +9,27 @@ import {
|
||||
} from '@/components/ui/dialog';
|
||||
import { renameWarrenEntry } from '~/lib/api/warrens';
|
||||
|
||||
const warrenRoute = useWarrenRoute();
|
||||
const warrenStore = useWarrenStore();
|
||||
const dialog = useRenameDirectoryDialog();
|
||||
|
||||
const renaming = ref(false);
|
||||
const directoryNameValid = computed(() => dialog.value.trim().length > 0);
|
||||
|
||||
async function submit() {
|
||||
if (dialog.entry == null || !directoryNameValid.value || renaming.value) {
|
||||
if (
|
||||
dialog.entry == null ||
|
||||
!directoryNameValid.value ||
|
||||
renaming.value ||
|
||||
warrenStore.current == null
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
renaming.value = true;
|
||||
|
||||
const { success } = await renameWarrenEntry(
|
||||
warrenRoute.value,
|
||||
warrenStore.current.warrenId,
|
||||
warrenStore.current.path,
|
||||
dialog.entry.name,
|
||||
dialog.value
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user