Skip to content

Commit

Permalink
Fix merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
b12f committed Jun 29, 2023
1 parent de7af3b commit 61b6bd0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 4 additions & 0 deletions components/paths/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ func WorkPackage(id uint64) string {
func WorkPackages() string {
return Root() + "/work_packages"
}

func WorkPackageActivities(id uint64) string {
return WorkPackage(id) + "/activities"
}
6 changes: 3 additions & 3 deletions components/resources/users/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ func ByIds(ids []uint64) []*models.User {

requestUrl := usersPath

status, response := requests.Get(requestUrl, &query)
if !requests.IsSuccess(status) {
printer.ResponseError(status, response)
response, err := requests.Get(requestUrl, &query)
if err != nil {
printer.Error(err)
}

userCollection := parser.Parse[dtos.UserCollectionDto](response)
Expand Down
10 changes: 4 additions & 6 deletions components/resources/work_packages/activities.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
package work_packages

import (
"path/filepath"
"strconv"

"github.com/opf/openproject-cli/components/parser"
"github.com/opf/openproject-cli/components/paths"
"github.com/opf/openproject-cli/components/printer"
"github.com/opf/openproject-cli/components/requests"
"github.com/opf/openproject-cli/dtos"
"github.com/opf/openproject-cli/models"
)

func Activities(id uint64) (activites []*models.Activity, err error) {
status, response := requests.Get(filepath.Join(workPackagesPath, strconv.FormatUint(id, 10), "activities"), nil)
if !requests.IsSuccess(status) {
printer.ResponseError(status, response)
response, err := requests.Get(paths.WorkPackageActivities(id), nil)
if err != nil {
printer.Error(err)
}

activitiesDto := parser.Parse[dtos.ActivityCollectionDto](response)
Expand Down

0 comments on commit 61b6bd0

Please sign in to comment.