Skip to content

Commit

Permalink
Merge branch 'main' into feature/26-add-post-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasHavekes authored Mar 23, 2024
2 parents 4a68927 + 00492e1 commit 1c508f8
Show file tree
Hide file tree
Showing 7 changed files with 2,615 additions and 2,493 deletions.
2 changes: 1 addition & 1 deletion canopeum_backend/canopeum_backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"USER": "root",
"PASSWORD": "canopeum",
"HOST": "localhost",
"PORT": "3306",
"PORT": "3308", # Same as in docker-compose.yml
},
}

Expand Down
7 changes: 2 additions & 5 deletions canopeum_backend/canopeum_backend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,8 @@ class PostListAPIView(APIView):
def get(self, request):
comment_count = Comment.objects.filter(post=request.data.get("id")).count()
has_liked = 0
siteId = request.GET.get("siteId", "")
if siteId != "":
posts = Post.objects.filter(site=siteId)
else:
posts = Post.objects.all()
site_id = request.GET.get("siteId", "")
posts = Post.objects.filter(site=site_id) if not site_id else Post.objects.all()
serializer = PostSerializer(posts, many=True, context={"comment_count": comment_count, "has_liked": has_liked})
return Response(serializer.data)

Expand Down
4 changes: 2 additions & 2 deletions canopeum_frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const Home = () => {
const fetchData = async () => {
setIsLoading(true)
try {
const response = await api().analytics.batches();
setData(response);
const response = await api().analytics.batches()
setData(response)
} catch (error_: unknown) {
setError(ensureError(error_))
} finally {
Expand Down
Loading

0 comments on commit 1c508f8

Please sign in to comment.