Edit and create seem to more or less work (including selection of the parent). Delete is pending.
This commit is contained in:
parent
61893d77f6
commit
5b82d3b540
12 changed files with 322 additions and 176 deletions
|
@ -46,6 +46,14 @@ async function updateWithConsistencyCheck(ns) {
|
|||
throw new interoperableErrors.ChangedError();
|
||||
}
|
||||
|
||||
let iter = ns;
|
||||
while (iter.parent != null) {
|
||||
iter = await tx('namespaces').where('id', iter.parent).first();
|
||||
if (iter.id == ns.id) {
|
||||
throw new interoperableErrors.LoopDetectedError();
|
||||
}
|
||||
}
|
||||
|
||||
await tx('namespaces').where('id', ns.id).update(filterObject(ns, allowedUpdateKeys));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue