Honestly way too much went into this single commit. I am so sorry future me

This commit is contained in:
Emma
2023-06-09 00:54:00 -06:00
parent cd3f653f3f
commit 42c0004150
67 changed files with 4617 additions and 92 deletions

View File

@@ -0,0 +1,24 @@
import { Schema } from '../types/schema';
export const GameSystemsService = {
// todo - connect to service to save schema for game
saveSchema: async (schema: Schema) => {
localStorage.setItem('schema', JSON.stringify(schema));
return { status: 200 }
},
// todo - connect to service to fetch schema for game
getSchema: async (id: string) => {
const schema = localStorage.getItem('schema');
if (schema)
return {
status: 200,
json: async () => JSON.parse(schema)
}
return {
status: 404
}
}
}