Bug fixes + Save status
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user