Skip to content

Commit

Permalink
add SetProfileData method
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagleft committed Feb 19, 2023
1 parent 7f3b72a commit 6941540
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions v2/internal/utopia/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ func (c *UtopiaClient) SetProfileStatus(status string, mood string) error {
return nil
}

func (c *UtopiaClient) SetProfileData(nick, firstName, lastName string) error {
result, err := c.queryResultToBool(reqSetProfiltData, uMap{
"nick": nick,
"firstName": firstName,
"lastName": lastName,
})
if err != nil {
return err
}
if !result {
return ErrorSetProfileData
}
return nil
}

func (c *UtopiaClient) GetOwnContact() (structs.OwnContactData, error) {
r := structs.OwnContactData{}
err := c.getSimpleStruct(reqGetOwnContact, &r)
Expand Down
2 changes: 2 additions & 0 deletions v2/internal/utopia/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (
reqGetProfileStatus = "getProfileStatus"
reqGetSystemInfo = "getSystemInfo"
reqSetProfileStatus = "setProfileStatus"
reqSetProfiltData = "setProfileData"
reqGetOwnContact = "getOwnContact"
reqUseVoucher = "useVoucher"
reqGetFinanceSystemInformation = "getFinanceSystemInformation"
Expand All @@ -41,5 +42,6 @@ const (

var (
ErrorSetProfileStatus = errors.New("failed to set profile status")
ErrorSetProfileData = errors.New("failed to set profile data")
ErrorClientDisconnected = errors.New("client disconected")
)

0 comments on commit 6941540

Please sign in to comment.