mirror of
https://github.com/mrusme/neonmodem.git
synced 2025-01-03 14:56:41 -05:00
Fixed topics path
This commit is contained in:
parent
e0539b4954
commit
b78f1d0c46
@ -83,6 +83,10 @@ var rootCmd = &cobra.Command{
|
||||
fmt.Println("-----------------------")
|
||||
fmt.Printf("%v\n", posts)
|
||||
fmt.Printf("%v\n", err)
|
||||
|
||||
err = (*c.Systems[0]).LoadPost(&posts[4])
|
||||
fmt.Printf("%v\n", posts[4].Replies[2])
|
||||
fmt.Printf("%v\n", err)
|
||||
os.Exit(0)
|
||||
|
||||
tui := tea.NewProgram(ui.NewModel(&c), tea.WithAltScreen())
|
||||
|
@ -123,7 +123,7 @@ func (sys *System) ListPosts() ([]post.Post, error) {
|
||||
func (sys *System) LoadPost(p *post.Post) error {
|
||||
item, err := sys.client.Topics.Show(context.Background(), p.ID)
|
||||
if err != nil {
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
for idx, i := range item.PostStream.Posts {
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
const TopicsBaseURL = "/topics"
|
||||
const TopicsBaseURL = "/t"
|
||||
|
||||
type LatestTopicsResponse struct {
|
||||
Users []struct {
|
||||
@ -94,7 +94,7 @@ func (a *TopicServiceHandler) Show(
|
||||
ctx context.Context,
|
||||
id string,
|
||||
) (*SingleTopicResponse, error) {
|
||||
uri := TopicsBaseURL + "/t/" + id + ".json"
|
||||
uri := TopicsBaseURL + "/" + id + ".json"
|
||||
|
||||
req, err := a.client.NewRequest(ctx, http.MethodGet, uri, nil)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user