ToUpdateParams converts UserUpdate to services.UserUpdateParams
()
| 25 | |
| 26 | // ToUpdateParams converts UserUpdate to services.UserUpdateParams |
| 27 | func (input *UserUpdate) ToUpdateParams() services.UserUpdateParams { |
| 28 | location, err := time.LoadLocation(input.Timezone) |
| 29 | if err != nil { |
| 30 | location = time.UTC |
| 31 | } |
| 32 | |
| 33 | var activePhoneID *uuid.UUID |
| 34 | if input.ActivePhoneID != "" { |
| 35 | val := uuid.MustParse(input.ActivePhoneID) |
| 36 | activePhoneID = &val |
| 37 | } |
| 38 | |
| 39 | return services.UserUpdateParams{ |
| 40 | ActivePhoneID: activePhoneID, |
| 41 | Timezone: location, |
| 42 | } |
| 43 | } |