File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,16 @@ export const meta: MetaFunction = () => {
4747} ;
4848
4949export async function loader ( { params, request } : LoaderFunctionArgs ) {
50- await requireUserId ( request ) ;
50+ const userId = await requireUserId ( request ) ;
5151 const { organizationSlug } = OrganizationParamsSchema . parse ( params ) ;
5252
5353 const { isManagedCloud } = featuresForRequest ( request ) ;
5454 if ( ! isManagedCloud ) {
5555 return redirect ( organizationPath ( { slug : organizationSlug } ) ) ;
5656 }
5757
58- const organization = await prisma . organization . findUnique ( {
59- where : { slug : organizationSlug } ,
58+ const organization = await prisma . organization . findFirst ( {
59+ where : { slug : organizationSlug , members : { some : { userId } } } ,
6060 } ) ;
6161
6262 if ( ! organization ) {
You can’t perform that action at this time.
0 commit comments