another fix for export import templates
This commit is contained in:
parent
b9f66cbfbe
commit
082a637719
|
|
@ -22,6 +22,11 @@ class ImportTemplate extends Model
|
|||
'reactivate' => 'boolean',
|
||||
];
|
||||
|
||||
public function getRouteKeyName(): string
|
||||
{
|
||||
return 'uuid';
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
|
|
|
|||
|
|
@ -125,7 +125,23 @@ function handleFileChange(event) {
|
|||
}
|
||||
|
||||
function performImport() {
|
||||
importForm.post(route("importTemplates.import"), {
|
||||
// Convert string IDs to integers before submitting
|
||||
const formData = {
|
||||
...importForm.data(),
|
||||
segment_id: importForm.segment_id ? parseInt(importForm.segment_id) : null,
|
||||
decision_id: importForm.decision_id ? parseInt(importForm.decision_id) : null,
|
||||
action_id: importForm.action_id ? parseInt(importForm.action_id) : null,
|
||||
activity_action_id: importForm.activity_action_id
|
||||
? parseInt(importForm.activity_action_id)
|
||||
: null,
|
||||
activity_decision_id: importForm.activity_decision_id
|
||||
? parseInt(importForm.activity_decision_id)
|
||||
: null,
|
||||
};
|
||||
|
||||
importForm
|
||||
.transform(() => formData)
|
||||
.post(route("importTemplates.import"), {
|
||||
preserveScroll: true,
|
||||
onSuccess: () => {
|
||||
importModalOpen.value = false;
|
||||
|
|
@ -271,14 +287,14 @@ const props = defineProps({
|
|||
<AlertDialogCancel @click="cancelDelete" :disabled="deleteForm.processing">
|
||||
Prekliči
|
||||
</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
<Button
|
||||
@click="performDelete"
|
||||
:disabled="deleteForm.processing"
|
||||
class="bg-destructive hover:bg-destructive/90"
|
||||
>
|
||||
<span v-if="deleteForm.processing">Brisanje…</span>
|
||||
<span v-else>Izbriši</span>
|
||||
</AlertDialogAction>
|
||||
</Button>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user