perf: Slim down trpc queries in Settings Layout (#20918)
* slim down settings layout by removing server queries * add check method * fix type check * refactor
This commit is contained in:
1 parent
513f54f4fe
commit
d844fd6ef7
5 files changed
+33
-54
No files matched your search
@@ -44,6 +44,14 @@ const checkDelegationCredentialFeature = async ({
|
||||
};
|
||||
|
||||
export const delegationCredentialRouter = router({
|
||||
check: authedOrgAdminProcedure.query(async (opts) => {
|
||||
return await checkDelegationCredentialFeature({
|
||||
ctx: opts.ctx,
|
||||
next: async () => ({
|
||||
hasDelegationCredential: true,
|
||||
}),
|
||||
});
|
||||
}),
|
||||
list: authedOrgAdminProcedure.use(checkDelegationCredentialFeature).query(async (opts) => {
|
||||
const handler = await import("./list.handler").then((mod) => mod.default);
|
||||
return handler(opts);
|
||||
|
||||
Reference in new issue
Block a user