fix bug where a row may not be deleted from the db if it’s in rowsLocal

This commit is contained in:
Sidney Alcantara
2022-10-04 16:11:11 +11:00
parent 9f850a692e
commit 46bf61c47b

View File

@@ -213,7 +213,9 @@ export const deleteRowAtom = atom(
find(tableRowsLocal, ["_rowy_ref.path", path])
);
if (isLocalRow) set(tableRowsLocalAtom, { type: "delete", path });
else await deleteRowDb(path);
// Always delete from db in case it exists
await deleteRowDb(path);
if (auditChange) auditChange("DELETE_ROW", path);
};