mod(taskwarrior): complete push implementation

Currently the merging process is not working entirely as I would
expect. There are no checks for actual changes between the local version
and the server version. WIP for #3. Configuration file created with
corresponding values like, user name and access code, which are - for
obvious reasons - not commited.
This commit is contained in:
2023-10-25 17:14:54 +02:00
parent 0cb4190540
commit 854dafde01
8 changed files with 160 additions and 47 deletions

View File

@@ -81,9 +81,8 @@ func (gitea *Gitea) GetIssue(repo Repository, id uint) (Issue, error) {
return issue, nil
}
// FIXME: how to do basic authorization?
func (gitea *Gitea) UpdateIssue(repo Repository, issue Issue) error {
url := fmt.Sprintf("%s/repos/%s/issues/%d", gitea.Url(), repo.Full_name, issue.Id)
url := fmt.Sprintf("%s/repos/%s/issues/%d", gitea.Url(), repo.Full_name, issue.Number)
payload := make(map[string]interface{})
// payload["assignee"] = issue.Assignee
// payload["assignees"] = issue.Assignees
@@ -100,6 +99,7 @@ func (gitea *Gitea) UpdateIssue(repo Repository, issue Issue) error {
}
client := &http.Client{}
request, err := http.NewRequest(http.MethodPatch, url, bytes.NewBuffer(json))
request.SetBasicAuth(gitea.User_name, gitea.Access_code)
request.Header.Set("content-type", "application/json")
if err != nil {
return err