ENCOA-314 :
- Implemented Async Select - Changed Stats Page User fetching to use Async Select and only fetch the User data when it needs - Changed Record Filter to use Async Select - Changed useTicketListener to only fetch needed data - Added Sort/Projection to remove unnecessary data processing. - Removed some unnecessary data processing.
This commit is contained in:
@@ -29,10 +29,10 @@ export const getEntitiesWithRoles = async (ids?: string[]): Promise<EntityWithRo
|
||||
return entities.map((x) => ({ ...x, roles: roles.filter((y) => y.entityID === x.id) || [] }));
|
||||
};
|
||||
|
||||
export const getEntities = async (ids?: string[]) => {
|
||||
export const getEntities = async (ids?: string[], projection = {}) => {
|
||||
return await db
|
||||
.collection("entities")
|
||||
.find<Entity>(ids ? { id: { $in: ids } } : {})
|
||||
.find<Entity>(ids ? { id: { $in: ids } } : {}, projection)
|
||||
.toArray();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user