Skip to content

Commit

Permalink
fix issue count of project Details page (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
YourBroCode authored Jan 31, 2025
1 parent 53585bf commit 9fd5d35
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/apps/github/index/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class UserIndex(AlgoliaIndex, IndexBase):
"idx_email",
"idx_followers_count",
"idx_following_count",
"idx_issues_count",
"idx_key",
"idx_location",
"idx_login",
Expand Down
1 change: 1 addition & 0 deletions backend/apps/owasp/index/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ProjectIndex(AlgoliaIndex, IndexBase):
"idx_custom_tags",
"idx_description",
"idx_forks_count",
"idx_issues_count",
"idx_is_active",
"idx_key",
"idx_languages",
Expand Down
5 changes: 5 additions & 0 deletions backend/apps/owasp/models/mixins/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,8 @@ def idx_type(self):
def idx_updated_at(self):
"""Return updated at for indexing."""
return self.updated_at.timestamp() if self.updated_at else ""

@property
def idx_issues_count(self):
"""Return issues count for indexing."""
return self.open_issues.count()
1 change: 1 addition & 0 deletions frontend/src/utils/paramsMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const getParamsForIndexName = (indexName: string, distinct = false) => {
attributesToRetrieve: [
'idx_contributors_count',
'idx_forks_count',
'idx_issues_count',
'idx_is_active',
'idx_key',
'idx_languages',
Expand Down

0 comments on commit 9fd5d35

Please # to comment.