Removed id from map update data

This commit is contained in:
Mitchell McCaffrey 2020-10-23 23:35:43 +11:00
parent b91d0e4157
commit 97c436b5e4
2 changed files with 3 additions and 2 deletions

View File

@ -131,7 +131,7 @@ export function MapDataProvider({ children }) {
} }
async function updateMap(id, update) { async function updateMap(id, update) {
console.log("updating", update); console.log("updating", id, update);
await database.table("maps").update(id, update); await database.table("maps").update(id, update);
setMaps((prevMaps) => { setMaps((prevMaps) => {
const newMaps = [...prevMaps]; const newMaps = [...prevMaps];

View File

@ -318,7 +318,8 @@ function NetworkedMapAndTokens({ session }) {
} }
} }
if (id === "mapResponse") { if (id === "mapResponse") {
await updateMap(data.id, data); const { id, ...update } = data;
await updateMap(id, update);
const newMap = await getMapFromDB(data.id); const newMap = await getMapFromDB(data.id);
setCurrentMap(newMap); setCurrentMap(newMap);
} }