Add function to categorize gamemaster data into Pokémon, forms, and moves

This commit is contained in:
2026-01-28 19:07:35 +00:00
parent 5785985419
commit 0a7b920bb5
2 changed files with 73 additions and 8 deletions

View File

@@ -257,17 +257,12 @@ async function saveToServer() {
error.value = null;
try {
const response = await fetch('/api/gamemaster/save', {
// Call the server endpoint to fetch and process on the server
const response = await fetch('/api/gamemaster/process', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
pokemon: processedData.value.pokemon,
pokemonAllForms: processedData.value.pokemonAllForms,
moves: processedData.value.moves,
raw: rawGamemaster.value
})
}
});
if (!response.ok) {
@@ -275,7 +270,10 @@ async function saveToServer() {
throw new Error(err.error || 'Failed to save to server');
}
const result = await response.json();
saveSuccess.value = true;
console.log('✅ Files saved to server:', result);
// Reload server status
await loadServerStatus();
} catch (err) {