Skip to content

Commit

Permalink
change post to put - api call
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerHeber committed Apr 7, 2024
1 parent 4f64d85 commit 9538b03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/team_project_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type TeamProjectAssignment struct {
func (client *ApiClient) TeamProjectAssignmentCreateOrUpdate(payload *TeamProjectAssignmentPayload) (*TeamProjectAssignment, error) {
var result TeamProjectAssignment

if err := client.http.Post("/roles/assignments/teams", payload, &result); err != nil {
if err := client.http.Put("/roles/assignments/teams", payload, &result); err != nil {
return nil, err
}

Expand Down
4 changes: 2 additions & 2 deletions client/team_project_assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ var _ = Describe("TeamProjectAssignment", func() {
Role: dummyProjectRole,
}
httpCall = mockHttpClient.EXPECT().
Post("/roles/assignments/teams", &expectedPayload, gomock.Any()).
Put("/roles/assignments/teams", &expectedPayload, gomock.Any()).
Do(func(path string, request interface{}, response *TeamProjectAssignment) {
*response = mockTeamProjectAssignment
}).Times(1)
teamProjectAssignment, _ = apiClient.TeamProjectAssignmentCreateOrUpdate(&expectedPayload)

})

It("Should send POST request with params", func() {})
It("Should send PUT request with params", func() {})

It("Should return a new resource with id", func() {
Expect(*teamProjectAssignment).To(Equal(mockTeamProjectAssignment))
Expand Down

0 comments on commit 9538b03

Please sign in to comment.