Skip to content

Commit

Permalink
Merge pull request #300 from Simply-Stream/fix/typos
Browse files Browse the repository at this point in the history
Fix charity campaign/donations mock endpoints
  • Loading branch information
Xemdo committed Dec 13, 2023
2 parents 237b300 + 19ce495 commit 5e37b40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion internal/mock_api/endpoints/charity/campaigns.go
Expand Up @@ -42,7 +42,7 @@ type GetCharityCampaignResponse struct {
CharityDescription string `json:"charity_description"`
CharityLogo string `json:"charity_logo"`
CharityWebsite string `json:"charity_website"`
CurrentAmount CharityAmount `json:"current_ammount"`
CurrentAmount CharityAmount `json:"current_amount"`
TargetAmount CharityAmount `json:"target_amount"`
}

Expand Down
22 changes: 12 additions & 10 deletions internal/mock_api/endpoints/charity/donations.go
Expand Up @@ -34,11 +34,12 @@ var donationsScopesByMethod = map[string][]string{
type CharityDonations struct{}

type GetCharityDonationsResponse struct {
ID string `json:"campaign_id"`
UserID string `json:"user_id"`
UserLogin string `json:"user_login"`
UserName string `json:"user_name"`
TargetAmount CharityAmount `json:"target_amount"`
ID string `json:"id"`
CampaignID string `json:"campaign_id"`
UserID string `json:"user_id"`
UserLogin string `json:"user_login"`
UserName string `json:"user_name"`
Amount CharityAmount `json:"amount"`
}

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

for i := 0; i < first; i++ {
d := GetCharityDonationsResponse{
ID: util.RandomGUID(),
UserID: userCtx.UserID,
UserName: user.DisplayName,
UserLogin: user.UserLogin,
TargetAmount: CharityAmount{
ID: util.RandomGUID(),
CampaignID: util.RandomGUID(),
UserID: userCtx.UserID,
UserName: user.DisplayName,
UserLogin: user.UserLogin,
Amount: CharityAmount{
Value: rand.Intn(150000-300) + 300, // Between $3 and $1,500
DecimalPlaces: 2,
Currency: "USD",
Expand Down

0 comments on commit 5e37b40

Please sign in to comment.