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