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);