Unify workspace dropdowns; Update layouts (#458)
Unified Account and Workspace drop-downs; Layout updates, now header lives within the PageBody component; Sidebars now use floating variant
This commit is contained in:
committed by
GitHub
parent
ca585e09be
commit
4bc8448a1d
@@ -20,19 +20,22 @@ export function enhanceAction<
|
||||
auth?: boolean;
|
||||
captcha?: boolean;
|
||||
schema?: z.ZodType<
|
||||
Config['captcha'] extends true ? Args & { captchaToken: string } : Args,
|
||||
z.ZodTypeDef
|
||||
Config['captcha'] extends true ? Args & { captchaToken: string } : Args
|
||||
>;
|
||||
},
|
||||
>(
|
||||
fn: (
|
||||
params: Config['schema'] extends ZodType ? z.infer<Config['schema']> : Args,
|
||||
params: Config['schema'] extends ZodType
|
||||
? z.output<Config['schema']>
|
||||
: Args,
|
||||
user: Config['auth'] extends false ? undefined : JWTUserData,
|
||||
) => Response | Promise<Response>,
|
||||
config: Config,
|
||||
) {
|
||||
return async (
|
||||
params: Config['schema'] extends ZodType ? z.infer<Config['schema']> : Args,
|
||||
params: Config['schema'] extends ZodType
|
||||
? z.output<Config['schema']>
|
||||
: Args,
|
||||
) => {
|
||||
type UserParam = Config['auth'] extends false ? undefined : JWTUserData;
|
||||
|
||||
@@ -80,6 +83,11 @@ export function enhanceAction<
|
||||
user = auth.data as UserParam;
|
||||
}
|
||||
|
||||
return fn(data, user);
|
||||
return fn(
|
||||
data as Config['schema'] extends ZodType
|
||||
? z.output<Config['schema']>
|
||||
: Args,
|
||||
user,
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user