Skip to content

Commit 97a6dd3

Browse files
committed
Fixed again
1 parent e1d64d9 commit 97a6dd3

5 files changed

Lines changed: 104 additions & 75 deletions

File tree

.idea/workspace.xml

Lines changed: 98 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apiv1.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/k0kubun/pp"
88
"log"
99
"errors"
10+
"strings"
1011
)
1112

1213
func LinkApi(api iris.Party, manager *WorkManager) {
@@ -15,7 +16,7 @@ func LinkApi(api iris.Party, manager *WorkManager) {
1516
endpoint := c.Params().Get("endpoint")
1617
pp.Println(endpoint)
1718
for _, work := range manager.Works {
18-
if work.Name == endpoint {
19+
if strings.EqualFold(work.Name, endpoint) {
1920
filePath := "./data/" + work.Type + "_" +work.Name + ".json"
2021

2122
pp.Println(filePath)
@@ -53,7 +54,7 @@ func LinkApi(api iris.Party, manager *WorkManager) {
5354
c.StatusCode(iris.StatusInternalServerError)
5455
c.JSON(iris.Map{
5556
"data": nil,
56-
"error": errors.New("work not found, check uri endpoint"),
57+
"error": errors.New("work not found, check uri endpoint").Error(),
5758
})
5859
return
5960

csv_extractor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"bytes"
66
"os"
7-
"./scraper"
7+
"github.com/Chimpcode/bombo-open-api/scraper"
88
)
99

1010
func CreateCSVFromStruct(teams map[string]*scraper.Team) {

fetcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"encoding/json"
66
"strings"
77
"log"
8-
"./scraper"
8+
"github.com/Chimpcode/bombo-open-api/scraper"
99
)
1010

1111
func init() {

manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func LoadManagerFromFile (filePath string) (*WorkManager, error) {
3232
}
3333

3434
func SaveWorkManagerState(wm *WorkManager) error {
35-
data, err := json.Marshal(wm)
35+
data, err := json.MarshalIndent(wm, "", " ")
3636
if err != nil {
3737
return err
3838
}

0 commit comments

Comments
 (0)