Skip to content

Commit

Permalink
Changed Bounty to NewBounty
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Apr 30, 2024
1 parent 687a5fb commit 4ff090d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion db/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ type BountyOwners struct {
}

type BountyData struct {
Bounty NewBounty
NewBounty
BountyId uint `json:"bounty_id"`
BountyCreated int64 `json:"bounty_created"`
BountyUpdated *time.Time `json:"bounty_updated"`
Expand Down
2 changes: 1 addition & 1 deletion handlers/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (mh *metricHandler) GetMetricsBountiesData(metricBounties []db.NewBounty) [
workspace := mh.db.GetWorkspaceByUuid(bounty.WorkspaceUuid)

bountyData := db.BountyData{
Bounty: bounty,
NewBounty: bounty,
BountyId: bounty.ID,
Person: bountyOwner,
BountyCreated: bounty.Created,
Expand Down
8 changes: 4 additions & 4 deletions handlers/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ func TestMetricsBounties(t *testing.T) {

assert.Equal(t, http.StatusOK, rr.Code)
assert.Equal(t, res[0].BountyId, uint(1))
assert.Equal(t, res[0].Bounty.OwnerID, "owner-1")
assert.Equal(t, res[0].Bounty.Price, uint(100))
assert.Equal(t, res[0].Bounty.Title, "bounty 1")
assert.Equal(t, res[0].OwnerID, "owner-1")
assert.Equal(t, res[0].Price, uint(100))
assert.Equal(t, res[0].Title, "bounty 1")
assert.Equal(t, res[0].BountyDescription, "test bounty")
assert.Equal(t, res[0].BountyCreated, int64(1112))
})
Expand Down Expand Up @@ -230,7 +230,7 @@ func TestMetricsBounties(t *testing.T) {

// Assert that the response contains bounties only from the selected providers
for _, bounty := range res {
assert.Contains(t, []string{"provider1", "provider2"}, bounty.Bounty.OwnerID)
assert.Contains(t, []string{"provider1", "provider2"}, bounty.OwnerID)
}
})
}
Expand Down

0 comments on commit 4ff090d

Please sign in to comment.