✨ Refactor server save logic to include status reload and improve error handling
This commit is contained in:
@@ -265,7 +265,13 @@ function processGamemaster() {
|
|||||||
// Error handling through computed error state
|
// Error handling through computed error state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async () => {
|
|
||||||
|
async function saveToServer() {
|
||||||
|
if (!processedData.value) return;
|
||||||
|
|
||||||
|
saveSuccess.value = false;
|
||||||
|
resetSave();
|
||||||
|
await saveToServerData(async () => {
|
||||||
const result = await apiClient.post('/api/gamemaster/process', {});
|
const result = await apiClient.post('/api/gamemaster/process', {});
|
||||||
// Reload server status after save
|
// Reload server status after save
|
||||||
await loadServerStatus(async () => {
|
await loadServerStatus(async () => {
|
||||||
@@ -273,13 +279,7 @@ async () => {
|
|||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
};
|
});
|
||||||
async function saveToServer() {
|
|
||||||
if (!processedData.value) return;
|
|
||||||
|
|
||||||
saveSuccess.value = false;
|
|
||||||
resetSave();
|
|
||||||
await saveToServerData();
|
|
||||||
saveSuccess.value = !saveError.value;
|
saveSuccess.value = !saveError.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user