Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
minor improvements to code
  • Loading branch information
DiogoFerrao committed Apr 3, 2024
commit 36c974bd98193f46aee6d77e2d98e931225dd833
10 changes: 3 additions & 7 deletions internal/cmd/project/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,11 @@ func parseInput(cmd *cobra.Command) (*inputModel, error) {
}
}

parentId := flags.FlagToStringPointer(cmd, parentIdFlag)
projectIdLike := flags.FlagToStringSliceValue(cmd, projectIdLikeFlag)
member := flags.FlagToStringPointer(cmd, memberFlag)

return &inputModel{
GlobalFlagModel: globalFlags,
ParentId: parentId,
ProjectIdLike: projectIdLike,
Member: member,
ParentId: flags.FlagToStringPointer(cmd, parentIdFlag),
ProjectIdLike: flags.FlagToStringSliceValue(cmd, projectIdLikeFlag),
Member: flags.FlagToStringPointer(cmd, memberFlag),
CreationTimeAfter: creationTimeAfter,
Limit: limit,
PageSize: pageSize,
Expand Down
6 changes: 0 additions & 6 deletions internal/cmd/project/list/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ var testClient = &resourcemanager.APIClient{}
var testParentId = uuid.NewString()
var testProjectIdLike = uuid.NewString()
var testCreationTimeAfter = "2023-01-01T00:00:00Z"
var authUserEmail, _ = auth.GetAuthField(auth.USER_EMAIL)

func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string {
flagValues := map[string]string{
Expand Down Expand Up @@ -258,11 +257,6 @@ func TestParseInput(t *testing.T) {
}

func TestBuildRequest(t *testing.T) {
keyring.MockInit()
err := auth.SetAuthField(auth.USER_EMAIL, "test@test.com")
if err != nil {
t.Fatalf("Failed to set auth user email: %v", err)
}

authUserEmail, err := auth.GetAuthField(auth.USER_EMAIL)
if err != nil {
Expand Down