mirror of
https://github.com/mrusme/neonmodem.git
synced 2025-02-02 15:07:59 -05:00
Cleaned up response struct
This commit is contained in:
parent
42a3d1b5dc
commit
e838ec03a8
@ -13,10 +13,6 @@ import (
|
||||
"github.com/hashicorp/go-retryablehttp"
|
||||
)
|
||||
|
||||
type Response struct {
|
||||
Post PostModel `json:"post,omitempty"`
|
||||
}
|
||||
|
||||
type RequestError struct {
|
||||
Err error
|
||||
}
|
||||
|
@ -74,6 +74,10 @@ type PostModel struct {
|
||||
ReviewableScorePendingCount int `json:"reviewable_score_pending_count"`
|
||||
}
|
||||
|
||||
type ShowPostResponse struct {
|
||||
Post PostModel `json:"post,omitempty"`
|
||||
}
|
||||
|
||||
type ListPostsResponse struct {
|
||||
LatestPosts []PostModel `json:"latest_posts,omitempty"`
|
||||
}
|
||||
@ -128,7 +132,7 @@ func (a *PostServiceHandler) Show(
|
||||
return PostModel{}, err
|
||||
}
|
||||
|
||||
response := new(Response)
|
||||
response := new(ShowPostResponse)
|
||||
if err = a.client.Do(ctx, req, response); err != nil {
|
||||
return PostModel{}, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user