Removed id from map update data
This commit is contained in:
parent
b91d0e4157
commit
97c436b5e4
@ -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];
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user