tracardi
tracardi copied to clipboard
Endpoint that finds what plugins use the given resource
There is no easy way to find where the resource is used. When you want delete the resource we need a way to find all the plugins that use it. It can be helpful when the resource is deleted or on the resource details page.
Task
Create and enpoint
/resource/{id}/usage
Iterate over all workflows, unpack it and find plugins that use this workflow by id.
we have to find the better way. Resources may be used by imports and destinations as well
Your are right, then we have to look for the resources also in destinations and imports as well
@atompie actually that can be checked once while saving every workflow. Situation is easy for destinations and imports - we know the field to look for. We get decoded workflow while saving anyway, so we can look through it before encoding it and save it in a new field, so we can run regular search, which requires less effort for database and less time.