mirror of
https://github.com/mrusme/neonmodem.git
synced 2025-02-02 15:07:59 -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.Println("-----------------------")
|
||||||
fmt.Printf("%v\n", posts)
|
fmt.Printf("%v\n", posts)
|
||||||
fmt.Printf("%v\n", err)
|
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)
|
os.Exit(0)
|
||||||
|
|
||||||
tui := tea.NewProgram(ui.NewModel(&c), tea.WithAltScreen())
|
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 {
|
func (sys *System) LoadPost(p *post.Post) error {
|
||||||
item, err := sys.client.Topics.Show(context.Background(), p.ID)
|
item, err := sys.client.Topics.Show(context.Background(), p.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
for idx, i := range item.PostStream.Posts {
|
for idx, i := range item.PostStream.Posts {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
const TopicsBaseURL = "/topics"
|
const TopicsBaseURL = "/t"
|
||||||
|
|
||||||
type LatestTopicsResponse struct {
|
type LatestTopicsResponse struct {
|
||||||
Users []struct {
|
Users []struct {
|
||||||
@ -94,7 +94,7 @@ func (a *TopicServiceHandler) Show(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
id string,
|
id string,
|
||||||
) (*SingleTopicResponse, error) {
|
) (*SingleTopicResponse, error) {
|
||||||
uri := TopicsBaseURL + "/t/" + id + ".json"
|
uri := TopicsBaseURL + "/" + id + ".json"
|
||||||
|
|
||||||
req, err := a.client.NewRequest(ctx, http.MethodGet, uri, nil)
|
req, err := a.client.NewRequest(ctx, http.MethodGet, uri, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user