Skip to content

Commit

Permalink
983 Filters out duplicate productTags
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardovdheijden committed Apr 8, 2024
1 parent 26751cc commit f25983b
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { TasksResponse, useGetTasksQuery, useLazyGetTasksQuery } from '@/rtk';
import type { GraphqlQueryVariables, TaskDefinition } from '@/types';
import { BadgeType, SortOrder } from '@/types';
import {
getConcatenatedResult,
getQueryVariablesForExport,
onlyUnique,
parseDateToLocaleDateTimeString,
Expand Down Expand Up @@ -195,13 +194,18 @@ export const WfoTasksPage = () => {
): TaskListExportItem[] => {
const { tasks } = tasksResponse;
return tasks.map(
({ name, target, description, createdAt, products }) => ({
name,
target,
description,
createdAt,
productTags: getConcatenatedResult(products, ['tag']),
}),
({ name, target, description, createdAt, products }) => {
const uniqueProducts = products
.map((product) => product.tag)
.filter(onlyUnique);
return {
name,
target,
description,
createdAt,
productTags: uniqueProducts.join(' - '),
};
},
);
};

Expand Down

0 comments on commit f25983b

Please sign in to comment.