only allow to add steps of user's workflow (#4637)
Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
1 parent
0a2de203a6
commit
4e6e484d8b
2 files changed
+5
-3
No files matched your search
@@ -616,9 +616,11 @@ export const workflowsRouter = createProtectedRouter()
|
||||
//added steps
|
||||
const addedSteps = steps.map((s) => {
|
||||
if (s.id <= 0) {
|
||||
const { id, ...stepToAdd } = s;
|
||||
if (stepToAdd) {
|
||||
const { id: stepId, ...stepToAdd } = s;
|
||||
if (stepToAdd.workflowId === id) {
|
||||
return stepToAdd;
|
||||
} else {
|
||||
throw new TRPCError({ code: "UNAUTHORIZED" });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user