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