Skip to content

Commit

Permalink
feat(database): display the actual number of diverse materials in the…
Browse files Browse the repository at this point in the history
… database

This commit adds functionality to the application to display the actual number of diverse materials in the database. Previously, the displayed number was not accurate and did not reflect the actual number of diverse materials in the database. With this new functionality, the application is able to provide users with an accurate count of the diverse materials, which helps to improve the user experience and the reliability of the application.
  • Loading branch information
khashashin committed Apr 8, 2023
1 parent 1f083a5 commit e30c02a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions backend/lakharg/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ def get(self, request, format=None):
stats = {
'unique_words': Words.objects.count(),
'books': Book.objects.count(),
'articles': Article.objects.count(),
'diverse': Diverse.objects.count(),
}

return Response(stats, status=200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ function FeaturesSection(props: FeaturesSectionProps) {

<Group align='flex-end' spacing='xs' mt={25}>
{item.title === 'Книги' && <Text>{stats?.data.books}</Text>}
{item.title !== 'Книги' && <Text>{item.count}</Text>}
{item.title === 'Остальное' && <Text>{stats?.data.diverse}</Text>}
{item.title !== 'Книги' && item.title !== 'Остальное' && <Text>{item.count}</Text>}
</Group>

<Text size='xs' color='dimmed' mt={7}>
Expand Down

0 comments on commit e30c02a

Please sign in to comment.