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