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 = () => {
47
47
} ;
48
48
49
49
export async function loader ( { params, request } : LoaderFunctionArgs ) {
50
- await requireUserId ( request ) ;
50
+ const userId = await requireUserId ( request ) ;
51
51
const { organizationSlug } = OrganizationParamsSchema . parse ( params ) ;
52
52
53
53
const { isManagedCloud } = featuresForRequest ( request ) ;
54
54
if ( ! isManagedCloud ) {
55
55
return redirect ( organizationPath ( { slug : organizationSlug } ) ) ;
56
56
}
57
57
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 } } } ,
60
60
} ) ;
61
61
62
62
if ( ! organization ) {
You can’t perform that action at this time.
0 commit comments