Skip to content

Commit

Permalink
feat: Announcement per page accept an id list on the params key (#4280)
Browse files Browse the repository at this point in the history
  • Loading branch information
novakzaballa authored Jul 3, 2024
1 parent 078bf1e commit e2685e9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frontend/web/components/AnnouncementPerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,18 @@ const AnnouncementPerPage: FC<AnnouncementPerPageType> = ({ pathname }) => {
obj1: AnnouncementPerPageValueType['params'],
obj2: AnnouncementPerPageValueType['params'],
) => {
return Object.keys(obj1).every((key) => {
return `${obj1[key]}` === `${obj2[key]}`
return Object.keys(obj2).every((key) => {
if (Array.isArray(obj2[key])) {
return obj2[key].some((item) => {
return `${item}` === `${obj1[key]}`
})
} else {
return `${obj1[key]}` === `${obj2[key]}`
}
})
}
const annParamsMatch = objectsMatch(annParams, matchParams)
const matchParamsMatch = objectsMatch(matchParams, annParams)
if (annParamsMatch || matchParamsMatch) {
if (matchParamsMatch) {
return true
}

Expand Down

0 comments on commit e2685e9

Please sign in to comment.