Closed mszostok closed 2 years ago
Example:
// Check if a given TypeInstance is not used by others
CALL {
WITH ti
WITH ti
MATCH (ti)-[:USES]->(others:TypeInstance)
WITH count(others) as othersLen
RETURN othersLen > 1 as isUsed
}
CALL apoc.util.validate(isUsed, apoc.convert.toJson({code: 400}), null)
It turns out that it was implemented but there was a bug that is fixed by https://github.com/capactio/capact/pull/654
Description
Blocked by: https://github.com/capactio/capact/issues/645
Prevent delete action when TypeInstance is used by others. Currently, we can delete TypeInstance without any notification that others are linked to it. In case of delegated storage proposal, this may break our flow as we won't be able to retrieve data for all linked TypeInstances.
Reason
Currently, we allow deleting TypeInstance that is used by others. Until now, it wasn't a big issue but after introducing delegated storage functionality, it will become more problematic as we use this relation to ask to resolve stored information.
Use cases
Additional
It's a small piece of the rollback proposal: https://github.com/capactio/capact/blob/main/docs/proposal/20201209-action-rollback.md - rest logic will be handled by dedicated issue #502