mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 03:54:21 +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:
|
code:
|
||||||
added: Telefon Code hinzugefügt
|
added: Telefon Code hinzugefügt
|
||||||
sent: Telefon Code versendet
|
sent: Telefon Code versendet
|
||||||
|
removed: Telefonnummer gelöscht
|
||||||
profile:
|
profile:
|
||||||
changed: Benutzerprofil geändert
|
changed: Benutzerprofil geändert
|
||||||
address:
|
address:
|
||||||
|
@ -282,6 +282,7 @@ EventTypes:
|
|||||||
code:
|
code:
|
||||||
added: Phone number code generated
|
added: Phone number code generated
|
||||||
sent: Phone number code sent
|
sent: Phone number code sent
|
||||||
|
removed: Phone number removed
|
||||||
profile:
|
profile:
|
||||||
changed: User profile changed
|
changed: User profile changed
|
||||||
address:
|
address:
|
||||||
|
@ -86,11 +86,18 @@ func (key *MachineKey) AppendEvents(events ...*es_models.Event) error {
|
|||||||
return nil
|
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 {
|
switch event.Type {
|
||||||
case MachineKeyAdded:
|
case MachineKeyAdded:
|
||||||
|
err = json.Unmarshal(event.Data, key)
|
||||||
|
if err != nil {
|
||||||
|
return errors.ThrowInternal(err, "MODEL-SjI4S", "Errors.Internal")
|
||||||
}
|
}
|
||||||
return nil
|
case MachineKeyRemoved:
|
||||||
|
key.ExpirationDate = event.CreationDate
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func MachineKeyFromModel(machine *model.MachineKey) *MachineKey {
|
func MachineKeyFromModel(machine *model.MachineKey) *MachineKey {
|
||||||
|
Loading…
Reference in New Issue
Block a user