✨ Add function to categorize gamemaster data into Pokémon, forms, and moves
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user