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