Skip to content

Commit

Permalink
Fix bug with partial deletes
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Feb 18, 2022
1 parent 3fa1ac8 commit b9cc09d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion oada/libs/lib-arangodb/src/libs/changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export async function putChange({
}

const number = Number.parseInt(rev as string, 10);
trace('putChange: inserting change with body %O', change);
trace({ change }, 'putChange: inserting change');
return (await (
await database.query(
aql`
Expand Down
4 changes: 2 additions & 2 deletions oada/libs/lib-arangodb/src/libs/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ export async function deletePartialResource(
pointer.set(document, null);

const name = aPath.pop();
const sPath = JsonPointer.create(aPath) || null;
const sPath = JsonPointer.create(aPath).toString() || null;
const cursor = await database.query({
query: `
LET res = DOCUMENT(${resources.name}, '${key}')
Expand All @@ -740,7 +740,7 @@ export async function deletePartialResource(
LET start = FIRST(
FOR node IN ${graphNodes}
LET path = node.path || null
FILTER node['resource_id'] == ${id} AND path == ${sPath ?? null}
FILTER node['resource_id'] == ${id} AND path == ${sPath}
RETURN node._id
)
LET vs = (
Expand Down

0 comments on commit b9cc09d

Please sign in to comment.