add logic to store event modification and deleted event

This commit is contained in:
soukainna
2023-02-01 09:58:37 +01:00
parent 5feb1b720e
commit 301f636072
11 changed files with 364 additions and 122 deletions

View File

@@ -70,3 +70,24 @@ func (h AgendaHandler) SubscribeEvent(eventid string, subscriber string, data ma
err = h.storage.AddSubscription(eventid, subscription)
return
}
// func (h AgendaHandler) UnsubscribeEvent(eventid string, subscriber string) (err error) {
// if eventid == "" || subscriber == "" {
// return errors.New("missing eventid or subscriber")
// }
// event, err = h.storage.GetEvent(eventid)
// for i := 0; i < event.Subscriptions; i++ {
// }
// return
// }
func (h AgendaHandler) UpdateEvent(event storage.Event) (*storage.Event, error) {
// Store the account
if err := h.storage.UpdateEvent(event); err != nil {
return nil, err
}
return &event, nil
}