perf: migrate listHandler to AttributeRepository + cache attributes fetching in RSCs (#21552)
* refactor: migrate listHandler to AttributeRepository Co-Authored-By: [email protected] <[email protected]> * cache attributes list --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]> Co-authored-by: hbjORbj <[email protected]>
This commit is contained in:
7 files changed
+39
-41
No files matched your search
@@ -42,4 +42,15 @@ export class AttributeRepository {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static async findAllByOrgIdWithOptions({ orgId }: { orgId: number }) {
|
||||
return await prisma.attribute.findMany({
|
||||
where: {
|
||||
teamId: orgId,
|
||||
},
|
||||
include: {
|
||||
options: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user