Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filter rest api #10537

Merged
merged 3 commits into from
Feb 27, 2025
Merged

Fix filter rest api #10537

merged 3 commits into from
Feb 27, 2025

Conversation

Weiko
Copy link
Member

@Weiko Weiko commented Feb 27, 2025

Context

Rest API is now using cache metadata but the change was not done everywhere which was breaking the API
Screenshot 2025-02-27 at 10 48 31

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR enhances the REST API filter system by standardizing on the ObjectMetadataItemWithFieldMaps type across multiple utility functions, improving both type safety and performance.

  • Replaced direct array searches with map-based lookups in check-filter-enum-values.ts and get-field-type.utils.ts, significantly improving performance for objects with many fields
  • Added explicit type definitions in GetVariablesFactory to ensure proper structure of the objectMetadata parameter
  • Updated FilterInputFactory to correctly use objectMetadataMapItem instead of objectMetadataItem when calling parseFilter
  • Modified test files to use more comprehensive mock objects that include both fieldsById and fieldsByName maps
  • Standardized parameter types across all filter-related utility functions for better consistency and maintainability

9 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@Weiko Weiko merged commit 084554e into main Feb 27, 2025
32 checks passed
@Weiko Weiko deleted the c--fix-filter-rest-api branch February 27, 2025 10:05
Weiko added a commit that referenced this pull request Feb 27, 2025
## Context
Rest API is now using cache metadata but the change was not done
everywhere which was breaking the API
<img width="953" alt="Screenshot 2025-02-27 at 10 48 31"
src="https://github.com/user-attachments/assets/84f549a6-59b5-4989-b1ba-2d5c515ee47c"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants