comparison pkg/controllers/routes.go @ 2155:51c5aead78c0

Print templates: Implemented /api/templates/print/{name} GET.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 08 Feb 2019 12:36:47 +0100
parents b66cfcde8ff7
children 7444b75d5497
comparison
equal deleted inserted replaced
2154:a08e0f532304 2155:51c5aead78c0
103 api.Handle("/templates/print/{name}", any(&JSONHandler{ 103 api.Handle("/templates/print/{name}", any(&JSONHandler{
104 Handle: fetchPrintTemplate, 104 Handle: fetchPrintTemplate,
105 })).Methods(http.MethodGet) 105 })).Methods(http.MethodGet)
106 106
107 api.Handle("/templates/print/{name}", waterwayAdmin(&JSONHandler{ 107 api.Handle("/templates/print/{name}", waterwayAdmin(&JSONHandler{
108 Input: func(*http.Request) interface{} { return new(models.PrintTemplateIn) },
108 Handle: createPrintTemplate, 109 Handle: createPrintTemplate,
110 Limit: maxPrintTemplateSize,
109 })).Methods(http.MethodPost) 111 })).Methods(http.MethodPost)
110 112
111 api.Handle("/templates/print/{name}", waterwayAdmin(&JSONHandler{ 113 api.Handle("/templates/print/{name}", waterwayAdmin(&JSONHandler{
112 Handle: deletePrintTemplate, 114 Handle: deletePrintTemplate,
113 })).Methods(http.MethodDelete) 115 })).Methods(http.MethodDelete)