add id and fix err
This commit is contained in:
@@ -59,6 +59,7 @@ func (h AgendaHandler) SubscribeEvent(eventid string, subscriber string, data ma
|
||||
subscription := storage.Subscription{
|
||||
ID: id,
|
||||
Subscriber: subscriber,
|
||||
EventID: eventid,
|
||||
Tags: []string{},
|
||||
CreatedAt: now,
|
||||
Data: map[string]any{},
|
||||
@@ -80,6 +81,7 @@ func (h AgendaHandler) DeleteSubscription(eventid string, subscriber string, dat
|
||||
deletesubscription := storage.Subscription{
|
||||
ID: id,
|
||||
Subscriber: subscriber,
|
||||
EventID: eventid,
|
||||
Tags: []string{},
|
||||
CreatedAt: now,
|
||||
Data: map[string]any{},
|
||||
@@ -101,6 +103,17 @@ func (h AgendaHandler) UpdateEvent(event storage.Event) (*storage.Event, error)
|
||||
return &event, nil
|
||||
}
|
||||
|
||||
func (h AgendaHandler) GetSubscriber(subscriber string) (results []storage.Subscription, err error) {
|
||||
if subscriber == "" {
|
||||
return nil, errors.New("missing subscriber")
|
||||
}
|
||||
results, err = h.storage.GetSubscriber(subscriber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return results, nil
|
||||
}
|
||||
|
||||
func (h AgendaHandler) GetSubscriptionByUser(subscriber string) (results []storage.Subscription, err error) {
|
||||
if subscriber == "" {
|
||||
return nil, errors.New("missing subscriber")
|
||||
|
||||
Reference in New Issue
Block a user