add function to store eventid and subscriberid
This commit is contained in:
parent
56d0914568
commit
62f64747c3
|
@ -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
|
3
main.go
3
main.go
|
@ -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{
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue