only allow to add steps of user's workflow (#4637)

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
pull/4644/head
Carina Wollendorfer 2022-09-20 13:00:43 -04:00 committed by GitHub
parent 0a2de203a6
commit 4e6e484d8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -465,7 +465,7 @@
"host_phone_number": "Ihre Telefonnummer",
"enter_phone_number": "Telefonnummer eingeben",
"reschedule": "Neuplanen",
"reschedule_this": "Stattdessen verschie",
"reschedule_this": "Stattdessen verschieben",
"book_a_team_member": "Teammitglied stattdessen buchen",
"or": "ODER",
"go_back": "Zurück",

View File

@ -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" });
}
}
});