Compare commits
2 Commits
1ff1c8faf4
...
6643466d76
| Author | SHA1 | Date | |
|---|---|---|---|
| 6643466d76 | |||
| 9dcf748474 |
@@ -63,13 +63,7 @@ func (h *PostHandler) GetPosts(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
postDTOs := dto.ToPostDTOs(posts)
|
responseDTO := dto.ToPostListDTO(posts, limit, offset)
|
||||||
responseDTO := dto.PostListDTO{
|
|
||||||
Posts: postDTOs,
|
|
||||||
Count: len(postDTOs),
|
|
||||||
Limit: limit,
|
|
||||||
Offset: offset,
|
|
||||||
}
|
|
||||||
SendSuccessResponse(w, "Posts retrieved successfully", responseDTO)
|
SendSuccessResponse(w, "Posts retrieved successfully", responseDTO)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,14 +224,7 @@ func (h *PostHandler) SearchPosts(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
postDTOs := dto.ToPostDTOs(posts)
|
responseDTO := dto.ToSearchPostListDTO(posts, query, limit, offset)
|
||||||
responseDTO := dto.SearchPostListDTO{
|
|
||||||
Posts: postDTOs,
|
|
||||||
Count: len(postDTOs),
|
|
||||||
Query: query,
|
|
||||||
Limit: limit,
|
|
||||||
Offset: offset,
|
|
||||||
}
|
|
||||||
SendSuccessResponse(w, "Search results retrieved successfully", responseDTO)
|
SendSuccessResponse(w, "Search results retrieved successfully", responseDTO)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,13 +46,7 @@ func (h *UserHandler) GetUsers(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
userDTOs := dto.ToSanitizedUserDTOs(users)
|
responseDTO := dto.ToSanitizedUserListDTO(users, limit, offset)
|
||||||
responseDTO := dto.SanitizedUserListDTO{
|
|
||||||
Users: userDTOs,
|
|
||||||
Count: len(userDTOs),
|
|
||||||
Limit: limit,
|
|
||||||
Offset: offset,
|
|
||||||
}
|
|
||||||
SendSuccessResponse(w, "Users retrieved successfully", responseDTO)
|
SendSuccessResponse(w, "Users retrieved successfully", responseDTO)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,13 +158,7 @@ func (h *UserHandler) GetUserPosts(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
postDTOs := dto.ToPostDTOs(posts)
|
responseDTO := dto.ToPostListDTO(posts, limit, offset)
|
||||||
responseDTO := dto.PostListDTO{
|
|
||||||
Posts: postDTOs,
|
|
||||||
Count: len(postDTOs),
|
|
||||||
Limit: limit,
|
|
||||||
Offset: offset,
|
|
||||||
}
|
|
||||||
SendSuccessResponse(w, "User posts retrieved successfully", responseDTO)
|
SendSuccessResponse(w, "User posts retrieved successfully", responseDTO)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user