add function to store eventid and subscriberid

This commit is contained in:
soukainna 2023-02-01 10:47:19 +01:00
parent 56d0914568
commit 62f64747c3
3 changed files with 33 additions and 2 deletions

View File

@ -330,6 +330,19 @@ func contains(s []*agenda.Subscription, e string) bool {
return false
}
///////////////////////////Delete subscriber///////////////////////////////
func (h *ApplicationHandler) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
eventid := vars["eventid"]
subscribeid := vars["subscribeid"]
fmt.Println(eventid)
fmt.Println(subscribeid)
h.Renderer.AgendaDeleteSubscribeEvent(w, r)
}
////////////////////////////////////////////////////////
// func contains[V string](s []V, e V) bool {
// for _, a := range s {
// if a == e {
@ -339,5 +352,4 @@ func contains(s []*agenda.Subscription, e string) bool {
// return false
// }
//test

View File

@ -137,6 +137,9 @@ func main() {
appAdmin.HandleFunc("/groups/{groupid}/invite-member", applicationHandler.AdministrationGroupInviteMember)
appAdmin.HandleFunc("/stats/vehicles", applicationHandler.AdminStatVehicles)
/////////////////////////////////////Delete subscriber///////////////////////////////////////////////
application.HandleFunc("/agenda/{eventid}/{subscribeid}/delete", applicationHandler.AgendaDeleteSubscribeEvent)
/////////////////////////////////////////////////////////////////////////////////////////////////////
fmt.Println("-> HTTP server listening on", address)
srv := &http.Server{

View File

@ -38,3 +38,19 @@ func (renderer *Renderer) AgendaDisplayEvent(w http.ResponseWriter, r *http.Requ
renderer.Render("agenda create event", w, r, files, state)
}
//////////////////////////DElete subscriber//////////////////////////////////
func (renderer *Renderer) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r *http.Request) {
files := renderer.ThemeConfig.GetStringSlice("views.agenda.delete_subscriber.files")
state := NewState(r, renderer.ThemeConfig, agendaMenu)
// state.ViewState = map[string]any{
// "event": event,
// "group": group,
// "subscribers": subscribers,
// "beneficiaries": beneficiaries,
// }
renderer.Render("agenda delete subscriber", w, r, files, state)
}
//////////////////////////////////////////////////////////