diff --git a/apps/web/modules/ee/contacts/segments/actions.ts b/apps/web/modules/ee/contacts/segments/actions.ts index f46f55f451..3a5194b19a 100644 --- a/apps/web/modules/ee/contacts/segments/actions.ts +++ b/apps/web/modules/ee/contacts/segments/actions.ts @@ -108,7 +108,7 @@ export const updateSegmentAction = authenticatedActionClient.schema(ZUpdateSegme "updated", "segment", async ({ ctx, parsedInput }: { ctx: AuthenticatedActionClientCtx; parsedInput: Record }) => { - const organizationId = await getOrganizationIdFromEnvironmentId(parsedInput.environmentId); + const organizationId = await getOrganizationIdFromSegmentId(parsedInput.segmentId); await checkAuthorizationUpdated({ userId: ctx.user.id, organizationId, diff --git a/apps/web/modules/ee/quotas/actions.ts b/apps/web/modules/ee/quotas/actions.ts index 7633e69607..8cffa4387f 100644 --- a/apps/web/modules/ee/quotas/actions.ts +++ b/apps/web/modules/ee/quotas/actions.ts @@ -46,7 +46,7 @@ export const deleteQuotaAction = authenticatedActionClient.schema(ZDeleteQuotaAc ctx: AuthenticatedActionClientCtx; parsedInput: z.infer; }) => { - const organizationId = await getOrganizationIdFromSurveyId(parsedInput.surveyId); + const organizationId = await getOrganizationIdFromQuotaId(parsedInput.quotaId); await checkQuotasEnabled(organizationId); await checkAuthorizationUpdated({ userId: ctx.user.id, @@ -58,7 +58,7 @@ export const deleteQuotaAction = authenticatedActionClient.schema(ZDeleteQuotaAc }, { type: "projectTeam", - projectId: await getProjectIdFromSurveyId(parsedInput.surveyId), + projectId: await getProjectIdFromQuotaId(parsedInput.quotaId), minPermission: "readWrite", }, ], @@ -91,7 +91,7 @@ export const updateQuotaAction = authenticatedActionClient.schema(ZUpdateQuotaAc ctx: AuthenticatedActionClientCtx; parsedInput: z.infer; }) => { - const organizationId = await getOrganizationIdFromSurveyId(parsedInput.quota.surveyId); + const organizationId = await getOrganizationIdFromQuotaId(parsedInput.quotaId); await checkQuotasEnabled(organizationId); await checkAuthorizationUpdated({ userId: ctx.user.id, @@ -103,7 +103,7 @@ export const updateQuotaAction = authenticatedActionClient.schema(ZUpdateQuotaAc }, { type: "projectTeam", - projectId: await getProjectIdFromSurveyId(parsedInput.quota.surveyId), + projectId: await getProjectIdFromQuotaId(parsedInput.quotaId), minPermission: "readWrite", }, ],