mirror of
https://github.com/makeplane/plane.git
synced 2026-08-29 10:08:51 +02:00
feat(api): enhance workspace module query to include member IDs (#9541)
Added an annotation to the WorkspaceModulesEndpoint to aggregate member IDs into an array, ensuring that only active members are included. This change improves the data structure returned by the API, allowing for better handling of member information in the frontend. Updated the corresponding utility function to handle potential null values for member IDs.
This commit is contained in:
@@ -30,8 +30,8 @@ export const orderModules = (modules: IModule[], orderByKey: TModuleOrderByOptio
|
||||
let orderedModules: IModule[] = [];
|
||||
if (modules.length === 0 || !orderByKey) return [];
|
||||
|
||||
if (orderByKey === "name") orderedModules = [...modules].sort((a, b) => naturalSort(a.name, b.name));
|
||||
if (orderByKey === "-name") orderedModules = [...modules].sort((a, b) => naturalSort(b.name, a.name));
|
||||
if (orderByKey === "name") orderedModules = [...modules].toSorted((a, b) => naturalSort(a.name, b.name));
|
||||
if (orderByKey === "-name") orderedModules = [...modules].toSorted((a, b) => naturalSort(b.name, a.name));
|
||||
if (["progress", "-progress"].includes(orderByKey))
|
||||
orderedModules = sortBy(modules, [
|
||||
(m) => {
|
||||
@@ -71,7 +71,7 @@ export const shouldFilterModule = (
|
||||
if (filterKey === "lead" && filters.lead && filters.lead.length > 0)
|
||||
fallsInFilters = fallsInFilters && filters.lead.includes(`${module.lead_id}`);
|
||||
if (filterKey === "members" && filters.members && filters.members.length > 0) {
|
||||
const memberIds = module.member_ids;
|
||||
const memberIds = module.member_ids ?? [];
|
||||
fallsInFilters = fallsInFilters && filters.members.some((memberId) => memberIds.includes(memberId));
|
||||
}
|
||||
if (filterKey === "start_date" && filters.start_date && filters.start_date.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user