Skip to content

Commit

Permalink
Typechecker & linter
Browse files Browse the repository at this point in the history
  • Loading branch information
MatissJanis committed Aug 2, 2024
1 parent e1e32cc commit bc194db
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,17 @@ function useSelectedCategories(

case 'oneOf':
return categories.filter(({ id }) =>
// @ts-expect-error TODO: fixed in dashboard pr
existingCategoryCondition.value.includes(id),
);

case 'notOneOf':
return categories.filter(
// @ts-expect-error TODO: fixed in dashboard pr
({ id }) => !existingCategoryCondition.value.includes(id),
);
}

return categories;
}, [existingCategoryCondition]);
}, [existingCategoryCondition, categories]);
}

export function CustomReport() {
Expand Down Expand Up @@ -144,8 +142,6 @@ export function CustomReport() {
}>
>([]);

console.log(' ccc', conditions);

// TODO: if there are multiple category conditions - do not allow calling this
const setSelectedCategories = (newCategories: CategoryEntity[]) => {
const newCategoryIdSet = new Set(newCategories.map(({ id }) => id));
Expand All @@ -156,8 +152,7 @@ export function CustomReport() {
const newCondition = {
field: 'category',
op: 'oneOf',
// TODO: manual type coercion should be fixed by dashboard PR
value: newCategories.map(({ id }) => id) as string[],
value: newCategories.map(({ id }) => id),
type: 'id',
} satisfies RuleConditionEntity;

Expand Down

0 comments on commit bc194db

Please sign in to comment.