Skip to content

Commit 9accb25

Browse files
committed
fix: strip filters
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
1 parent 693cf9a commit 9accb25

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

backend/src/services/organizationService.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,8 +1163,15 @@ export default class OrganizationService extends LoggerBase {
11631163
}
11641164

11651165
async query(data) {
1166-
const { filter, orderBy, limit, offset, segments, search: rawSearch } = data
1167-
const searchTerm = typeof rawSearch === 'string' && rawSearch.trim() ? rawSearch.trim() : undefined
1166+
const { filter: rawFilter, orderBy, limit, offset, segments, search: rawSearch } = data
1167+
const searchTerm =
1168+
typeof rawSearch === 'string' && rawSearch.trim() ? rawSearch.trim() : undefined
1169+
1170+
// Strip frontend-state keys that are never valid filter columns or operators.
1171+
// These can appear when the raw Pinia filter state is sent instead of the
1172+
// processed output of buildApiFilter.
1173+
const { search: _s, relation: _r, order: _o, settings: _st, ...filter } = rawFilter ?? {}
1174+
11681175
return OrganizationRepository.findAndCountAll(
11691176
{
11701177
filter,

0 commit comments

Comments
 (0)