Skip to content

Commit 52e55e9

Browse files
committed
Fixed some difference to the original API
- Also fixed a little typo on "campaigns.current_amount"
1 parent 11a468d commit 52e55e9

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
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

+11-9
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+
TargetAmount CharityAmount `json:"amount"`
4243
}
4344

4445
func (e CharityDonations) Path() string { return "/charity/donations" }
@@ -98,10 +99,11 @@ 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,
102+
ID: util.RandomGUID(),
103+
CampaignID: util.RandomGUID(),
104+
UserID: userCtx.UserID,
105+
UserName: user.DisplayName,
106+
UserLogin: user.UserLogin,
105107
TargetAmount: CharityAmount{
106108
Value: rand.Intn(150000-300) + 300, // Between $3 and $1,500
107109
DecimalPlaces: 2,

0 commit comments

Comments
 (0)