fix: don't delete uid of anonymous clients

This commit is contained in:
James Houlahan
2020-04-09 15:33:23 +02:00
parent ed8595fa5b
commit debd374d75
8 changed files with 48 additions and 33 deletions

View File

@ -27,6 +27,9 @@ func (api *FakePMAPI) GetEvent(eventID string) (*pmapi.Event, error) {
}
// Request for empty ID returns the latest event.
if eventID == "" {
if len(api.events) == 0 {
return &pmapi.Event{EventID: ""}, nil
}
return api.events[len(api.events)-1], nil
}
// Otherwise it tries to find specific ID and return all next events merged into one.