Files
go-cart-actor/pkg/profile/mutation_set_profile.go
T
mats 86797e520e
Build and Publish / BuildAndDeployArm64 (push) Failing after 5s
Build and Publish / BuildAndDeployAmd64 (push) Failing after 3s
add profile actors
2026-06-25 17:19:59 +02:00

34 lines
606 B
Go

package profile
import (
"fmt"
messages "git.k6n.net/mats/go-cart-actor/proto/profile"
)
// HandleSetProfile updates the user's core profile information.
func HandleSetProfile(p *ProfileGrain, m *messages.SetProfile) error {
if m == nil {
return fmt.Errorf("SetProfile: nil payload")
}
if m.Name != nil {
p.Name = *m.Name
}
if m.Email != nil {
p.Email = *m.Email
}
if m.Phone != nil {
p.Phone = *m.Phone
}
if m.Language != nil {
p.Language = *m.Language
}
if m.Currency != nil {
p.Currency = *m.Currency
}
if m.AvatarUrl != nil {
p.AvatarUrl = *m.AvatarUrl
}
return nil
}