Skip to content

Commit

Permalink
Merge branch 'release/v1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
namnhce committed Jan 5, 2024
2 parents 8ae4e69 + 8ee1bb6 commit a6009a4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/employee/earns.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (r *controller) GetEmployeeEarnTransactions(discordID string, input GetEmpl
Status: mochipay.TransactionStatusSuccess,
TokenAddress: mochipay.ICYAddress,
ChainID: mochipay.POLYGONChainID,
Participant: profile.Id,
ProfileID: profile.ID,
Platform: mochipay.TransactionPlatformDiscord,
Page: input.Page,
Size: input.Size,
Expand All @@ -45,7 +45,7 @@ func (r *controller) GetEmployeeTotalEarn(discordID string) (string, float64, er
Status: mochipay.TransactionStatusSuccess,
TokenAddress: mochipay.ICYAddress,
ChainID: mochipay.POLYGONChainID,
Participant: profile.Id,
ProfileID: profile.ID,
Platform: mochipay.TransactionPlatformDiscord,
Size: math.MaxInt64,
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/icy/icy.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (c *controller) offchainLockedIcyAmount() (*big.Int, error) {
return nil, err
}
for _, p := range res.Data {
profileIds = append(profileIds, p.Id)
profileIds = append(profileIds, p.ID)
}

hasNext := res.Pagination.Total/pageSize-page > 0
Expand Down
8 changes: 2 additions & 6 deletions pkg/service/mochipay/mochipay.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ func (m *client) GetListTransactions(req ListTransactionsRequest) (*ListTransact
queryParams.Add("token_address", req.TokenAddress)
}

if req.Participant != "" {
queryParams.Add("chain_id", req.ChainID)
}

if req.Platform != "" {
queryParams.Add("platform", string(req.Platform))
}
Expand All @@ -82,8 +78,8 @@ func (m *client) GetListTransactions(req ListTransactionsRequest) (*ListTransact
queryParams.Add("chain_id", req.ChainID)
}

if req.Participant != "" {
queryParams.Add("participant", req.Participant)
if req.ProfileID != "" {
queryParams.Add("profile_id", req.ProfileID)
}

url := fmt.Sprintf("%s/api/v1/transactions?", m.cfg.MochiPay.BaseURL) + queryParams.Encode()
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/mochipay/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type ListTransactionsRequest struct {
Status TransactionStatus `json:"status"`
ActionList []TransactionAction `json:"action_list"`
TokenAddress string `json:"token_address"`
Participant string `json:"participant"`
ProfileID string `json:"profile_id"`
Platform TransactionPlatform `json:"platform"`
ChainID string `json:"chain_id"`
Page int64 `json:"page"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/mochiprofile/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type GetMochiProfilesResponse struct {
}

type MochiProfile struct {
Id string `json:"id"`
ID string `json:"id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
ProfileName string `json:"profile_name"`
Expand Down

0 comments on commit a6009a4

Please sign in to comment.