mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +00:00
fix(machine): set creationdate (#1018)
* fix(machine): set creationdate * fix(translations): translate `user.human.phone.removed`
This commit is contained in:
parent
78a1b8f019
commit
42f50de790
@ -294,6 +294,7 @@ EventTypes:
|
||||
code:
|
||||
added: Telefon Code hinzugefügt
|
||||
sent: Telefon Code versendet
|
||||
removed: Telefonnummer gelöscht
|
||||
profile:
|
||||
changed: Benutzerprofil geändert
|
||||
address:
|
||||
|
@ -282,6 +282,7 @@ EventTypes:
|
||||
code:
|
||||
added: Phone number code generated
|
||||
sent: Phone number code sent
|
||||
removed: Phone number removed
|
||||
profile:
|
||||
changed: User profile changed
|
||||
address:
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user