1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-06-16 06:25:23 +00:00

Cleaned up response struct

This commit is contained in:
マリウス 2023-01-05 21:47:23 -05:00
parent 42a3d1b5dc
commit e838ec03a8
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F
2 changed files with 5 additions and 5 deletions

View File

@ -13,10 +13,6 @@ import (
"github.com/hashicorp/go-retryablehttp"
)
type Response struct {
Post PostModel `json:"post,omitempty"`
}
type RequestError struct {
Err error
}

View File

@ -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
}