mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 11:17:32 +00:00
fix(machine): set creationdate (#1018)
* fix(machine): set creationdate * fix(translations): translate `user.human.phone.removed`
This commit is contained in:
@@ -86,11 +86,18 @@ func (key *MachineKey) AppendEvents(events ...*es_models.Event) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (key *MachineKey) AppendEvent(event *es_models.Event) error {
|
||||
func (key *MachineKey) AppendEvent(event *es_models.Event) (err error) {
|
||||
key.ObjectRoot.AppendEvent(event)
|
||||
switch event.Type {
|
||||
case MachineKeyAdded:
|
||||
err = json.Unmarshal(event.Data, key)
|
||||
if err != nil {
|
||||
return errors.ThrowInternal(err, "MODEL-SjI4S", "Errors.Internal")
|
||||
}
|
||||
case MachineKeyRemoved:
|
||||
key.ExpirationDate = event.CreationDate
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
func MachineKeyFromModel(machine *model.MachineKey) *MachineKey {
|
||||
|
Reference in New Issue
Block a user