We want to have 3 mutations (create, delete, update) search string endpoints and the get string query endpoint.
The payload will be a simple (not prisma) object with 3 values, name, value and isOrg. name is the name of the search string, value is the value and the isOrg is a boolean that will indicate if this is an organization (shared) search string or a user one.
When we delete/update/create and the isOrg flag is on we need to check the user's privilages. Only administrators and operators would be able to create/update/delete shared search strings.
On the technical side of things, I think we should create only one model SearchString and the name,value,isOrg and parentId without any reference (but indexed). So when we query we will issue two queries on the same table, oen with parentId = userId and the other with parentId = organizationId
split from #565 to capture the backend work.
We want to have 3 mutations (create, delete, update) search string endpoints and the get string query endpoint.
The payload will be a simple (not prisma) object with 3 values, name, value and isOrg. name is the name of the search string, value is the value and the isOrg is a boolean that will indicate if this is an organization (shared) search string or a user one.
When we delete/update/create and the isOrg flag is on we need to check the user's privilages. Only administrators and operators would be able to create/update/delete shared search strings.
On the technical side of things, I think we should create only one model
SearchString
and the name,value,isOrg and parentId without any reference (but indexed). So when we query we will issue two queries on the same table, oen with parentId = userId and the other with parentId = organizationId