8000 WTF-781 Switch IDs from int to uint by senorprogrammer · Pull Request #3 · wtfutil/todoist · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

WTF-781 Switch IDs from int to uint #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// Project is a model of todoist project entity
type Project struct {
ID string `json:"id"`
ID uint `json:"id"`
Name string `json:"name"`
CommentCount int `json:"comment_count"`
Order int `json:"order"`
Expand Down Expand Up @@ -63,7 +63,7 @@ func ListProject() ([]Project, error) {
// }
// fmt.Println(project)
func GetProject(id string) (Project, error) {
path := fmt.Sprintf("projects/%s", id)
path := fmt.Sprintf("projects/%d", id)
res, err := makeRequest(http.MethodGet, path, nil)
if err != nil {
return Project{}, err
Expand Down Expand Up @@ -109,7 +109,7 @@ func CreateProject(name string) (Project, error) {
// panic(err)
// }
func (p Project) Delete() error {
path := fmt.Sprintf("projects/%s", p.ID)
path := fmt.Sprintf("projects/%d", p.ID)
_, err := makeRequest(http.MethodDelete, path, nil)
if err != nil {
return err
Expand All @@ -133,7 +133,7 @@ func (p Project) Delete() error {
// }
// fmt.Println(project)
func (p Project) Update() error {
path := fmt.Sprintf("projects/%s", p.ID)
path := fmt.Sprintf("projects/%d", p.ID)
project := struct {
Name string `json:"name"`
}{
Expand Down
10 changes: 5 additions & 5 deletions task.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// Task is a model of todoist project entity
type Task struct {
ID int `json:"id"`
ID uint `json:"id"`
CommentCount int `json:"comment_count"`
Completed bool `json:"completed"`
Content string `json:"content"`
Expand All @@ -24,10 +24,10 @@ type Task struct {

// Due is a model of todoist project entity
type Due struct {
String string `json:"string"`
Date string `json:"date"`
Datetime time.Time `json:"datetime,omitempty"`
Timezone string `json:"timezone"`
String string `json:"string"`
Date string `json:"date"`
Datetime time.Time `json:"datetime,omitempty"`
Timezone string `json:"timezone"`
}

func (t Task) taskSave() taskSave {
Expand Down
0