Bug fixes + Save status
Some checks failed
linter / quality (push) Successful in 4m14s
tests / ci (push) Failing after 12m30s

This commit is contained in:
2025-09-27 14:09:05 +02:00
parent cb242e59ba
commit b89fd67d57
10 changed files with 194 additions and 33 deletions

View File

@@ -28,20 +28,21 @@ async function sendChangedData(newData: ResumeInputData[]) {
clearTimeout(delayedSendTimeout);
}
delayedSendTimeout = setTimeout(async () => {
const { data, error } = await httpApi(route('resume-component-placements.update', newSelectedComponent), {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.getAttribute('content') || '',
'Accept': 'application/json'
},
body: JSON.stringify({ ...newSelectedComponent, _method: 'PUT' })
}, {immediate: true});
// Handle error
if (error) {
console.error('Failed to update component placement:', error, data);
return;
}
// const { data, error } = await httpApi(route('resume-component-placements.update', newSelectedComponent), {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json',
// 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.getAttribute('content') || '',
// 'Accept': 'application/json'
// },
// body: JSON.stringify({ ...newSelectedComponent, _method: 'PUT' })
// }, {immediate: true});
// // Handle error
// if (error) {
// console.error('Failed to update component placement:', error, data);
// return;
// }
resumeStore.modifyCurrentSelectedResumePlacementToApi(newSelectedComponent!);
}, SEND_CHANGED_DATA_DELAY);

View File

@@ -5,6 +5,7 @@ import ComponentsSelectionList from './ComponentsSelectionList.vue';
import { computed } from 'vue';
import { useResumesStore } from '@/stores/resume';
import { useShowComponentSelectionStore } from '@/stores/ui';
import SaveStatusIcon from '../SaveStatusIcon.vue';
const resumeStore = useResumesStore();
const selectedComponent = resumeStore.currentSelectedResumePlacement;
@@ -14,7 +15,8 @@ const showComponentSelection = computed<boolean>(() => showComponentSelectionSto
</script>
<template>
<div class="flex h-full flex-1 gap-4 rounded-xl p-4 overflow-x-auto max-w-[25%] bg-accent relative">
<div class="flex flex-col h-full flex-1 gap-4 rounded-xl p-4 overflow-x-auto max-w-[25%] bg-accent relative">
<SaveStatusIcon />
<Transition mode="out-in" appear>
<ResumeComponentEdit v-if="selectedComponent != null" :key="selectedComponent ? selectedComponent.id : 'form'" />
<ComponentsSelectionList v-else-if="showComponentSelection" />