Document gen fixed

This commit is contained in:
2025-10-12 17:52:17 +02:00
parent e0303ece74
commit 23f2011e33
16 changed files with 1116 additions and 88 deletions
@@ -189,6 +189,12 @@
{{ template.active ? "Deaktiviraj" : "Aktiviraj" }}
</button>
</form>
<form @submit.prevent="rescan">
<button type="submit" :class="[btnBase, btnOutline]" :disabled="rescanForm.processing">
<span v-if="rescanForm.processing">Pregledujem</span>
<span v-else>Ponovno preglej tokene</span>
</button>
</form>
<Link
:href="route('admin.document-templates.index')"
:class="[btnBase, btnOutline]"
@@ -212,9 +218,8 @@
</template>
<script setup>
import { Link } from "@inertiajs/vue3";
import { Link, useForm } from "@inertiajs/vue3";
import AdminLayout from "@/Layouts/AdminLayout.vue";
import { useForm } from "@inertiajs/vue3";
// Button style utility classes
const btnBase =
@@ -228,10 +233,18 @@ const props = defineProps({
});
const toggleForm = useForm({});
const rescanForm = useForm({});
function toggleActive() {
toggleForm.post(route("admin.document-templates.toggle", template.id), {
toggleForm.post(route("admin.document-templates.toggle", props.template.id), {
preserveScroll: true,
});
}
function rescan() {
rescanForm.post(route("admin.document-templates.rescan", props.template.id), {
preserveScroll: true,
only: ["template"],
});
}
</script>