only allow to add steps of user's workflow (#4637)
Co-authored-by: CarinaWolli <wollencarina@gmail.com>pull/4644/head
parent
0a2de203a6
commit
4e6e484d8b
|
@ -465,7 +465,7 @@
|
||||||
"host_phone_number": "Ihre Telefonnummer",
|
"host_phone_number": "Ihre Telefonnummer",
|
||||||
"enter_phone_number": "Telefonnummer eingeben",
|
"enter_phone_number": "Telefonnummer eingeben",
|
||||||
"reschedule": "Neuplanen",
|
"reschedule": "Neuplanen",
|
||||||
"reschedule_this": "Stattdessen verschie",
|
"reschedule_this": "Stattdessen verschieben",
|
||||||
"book_a_team_member": "Teammitglied stattdessen buchen",
|
"book_a_team_member": "Teammitglied stattdessen buchen",
|
||||||
"or": "ODER",
|
"or": "ODER",
|
||||||
"go_back": "Zurück",
|
"go_back": "Zurück",
|
||||||
|
|
|
@ -616,9 +616,11 @@ export const workflowsRouter = createProtectedRouter()
|
||||||
//added steps
|
//added steps
|
||||||
const addedSteps = steps.map((s) => {
|
const addedSteps = steps.map((s) => {
|
||||||
if (s.id <= 0) {
|
if (s.id <= 0) {
|
||||||
const { id, ...stepToAdd } = s;
|
const { id: stepId, ...stepToAdd } = s;
|
||||||
if (stepToAdd) {
|
if (stepToAdd.workflowId === id) {
|
||||||
return stepToAdd;
|
return stepToAdd;
|
||||||
|
} else {
|
||||||
|
throw new TRPCError({ code: "UNAUTHORIZED" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue