Skip to content

Commit 5e37b40

Browse files
authored
Merge pull request #300 from Simply-Stream/fix/typos
Fix charity campaign/donations mock endpoints
2 parents 237b300 + 19ce495 commit 5e37b40

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

internal/mock_api/endpoints/charity/campaigns.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type GetCharityCampaignResponse struct {
4242
CharityDescription string `json:"charity_description"`
4343
CharityLogo string `json:"charity_logo"`
4444
CharityWebsite string `json:"charity_website"`
45-
CurrentAmount CharityAmount `json:"current_ammount"`
45+
CurrentAmount CharityAmount `json:"current_amount"`
4646
TargetAmount CharityAmount `json:"target_amount"`
4747
}
4848

internal/mock_api/endpoints/charity/donations.go

+12-10
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ var donationsScopesByMethod = map[string][]string{
3434
type CharityDonations struct{}
3535

3636
type GetCharityDonationsResponse struct {
37-
ID string `json:"campaign_id"`
38-
UserID string `json:"user_id"`
39-
UserLogin string `json:"user_login"`
40-
UserName string `json:"user_name"`
41-
TargetAmount CharityAmount `json:"target_amount"`
37+
ID string `json:"id"`
38+
CampaignID string `json:"campaign_id"`
39+
UserID string `json:"user_id"`
40+
UserLogin string `json:"user_login"`
41+
UserName string `json:"user_name"`
42+
Amount CharityAmount `json:"amount"`
4243
}
4344

4445
func (e CharityDonations) Path() string { return "/charity/donations" }
@@ -98,11 +99,12 @@ func getCharityDonations(w http.ResponseWriter, r *http.Request) {
9899

99100
for i := 0; i < first; i++ {
100101
d := GetCharityDonationsResponse{
101-
ID: util.RandomGUID(),
102-
UserID: userCtx.UserID,
103-
UserName: user.DisplayName,
104-
UserLogin: user.UserLogin,
105-
TargetAmount: CharityAmount{
102+
ID: util.RandomGUID(),
103+
CampaignID: util.RandomGUID(),
104+
UserID: userCtx.UserID,
105+
UserName: user.DisplayName,
106+
UserLogin: user.UserLogin,
107+
Amount: CharityAmount{
106108
Value: rand.Intn(150000-300) + 300, // Between $3 and $1,500
107109
DecimalPlaces: 2,
108110
Currency: "USD",

0 commit comments

Comments
 (0)