add 'suscribed_by' in Data on DB

This commit is contained in:
Nicolas CARON 2023-02-03 15:23:49 +01:00
parent 11851fec61
commit 28c8fa8a90
1 changed files with 5 additions and 4 deletions

View File

@ -330,7 +330,8 @@ func contains(s []*agenda.Subscription, e string) bool {
return false return false
} }
// /////////////////////////Delete subscriber/////////////////////////////// ///////////////////////////Delete subscriber///////////////////////////////
func (h *ApplicationHandler) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r *http.Request) { func (h *ApplicationHandler) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r) vars := mux.Vars(r)
eventId := vars["eventid"] eventId := vars["eventid"]
@ -353,12 +354,12 @@ func (h *ApplicationHandler) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r
for i := range resp.Event.Subscriptions { for i := range resp.Event.Subscriptions {
if resp.Event.Subscriptions[i].Subscriber == subscribeid { if resp.Event.Subscriptions[i].Subscriber == subscribeid {
subscribed_by_id := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["user"].GetStructValue().Fields["id"].GetStringValue() subscribed_by_id := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["user"].GetStructValue().Fields["id"].GetStringValue()
s_b_id = subscribed_by_id
subscribed_by_name := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["user"].GetStructValue().Fields["display_name"].GetStringValue() subscribed_by_name := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["user"].GetStructValue().Fields["display_name"].GetStringValue()
s_b_name = subscribed_by_name
subscribed_by_group_id := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["group"].GetStructValue().Fields["id"].GetStringValue() subscribed_by_group_id := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["group"].GetStructValue().Fields["id"].GetStringValue()
s_b_group_id = subscribed_by_group_id
subscribed_by_group_name := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["group"].GetStructValue().Fields["name"].GetStringValue() subscribed_by_group_name := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["group"].GetStructValue().Fields["name"].GetStringValue()
s_b_id = subscribed_by_id
s_b_name = subscribed_by_name
s_b_group_id = subscribed_by_group_id
s_b_group_name = subscribed_by_group_name s_b_group_name = subscribed_by_group_name
} }
} }