Add inline tags form to payments
This commit is contained in:
parent
fa57c4b191
commit
a30e015639
|
@ -314,3 +314,11 @@ func servePaymentAttachment(w http.ResponseWriter, r *http.Request, params httpr
|
||||||
where slug = $1
|
where slug = $1
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func servePaymentTagsEditForm(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
|
||||||
|
serveTagsEditForm(w, r, params, "/payments/", "select tags from payment where slug = $1")
|
||||||
|
}
|
||||||
|
|
||||||
|
func handleUpdatePaymentTags(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
|
||||||
|
handleUpdateTags(w, r, params, "/payments/", "update payment set tags = $1 where slug = $2 returning slug")
|
||||||
|
}
|
||||||
|
|
|
@ -67,6 +67,8 @@ func NewRouter(db *Db, demo bool) http.Handler {
|
||||||
companyRouter.GET("/payments/:slug", servePaymentForm)
|
companyRouter.GET("/payments/:slug", servePaymentForm)
|
||||||
companyRouter.PUT("/payments/:slug", handleEditPayment)
|
companyRouter.PUT("/payments/:slug", handleEditPayment)
|
||||||
companyRouter.DELETE("/payments/:slug", handleRemovePayment)
|
companyRouter.DELETE("/payments/:slug", handleRemovePayment)
|
||||||
|
companyRouter.PUT("/payments/:slug/tags", handleUpdatePaymentTags)
|
||||||
|
companyRouter.GET("/payments/:slug/tags/edit", servePaymentTagsEditForm)
|
||||||
companyRouter.GET("/payments/:slug/download/:filename", servePaymentAttachment)
|
companyRouter.GET("/payments/:slug/download/:filename", servePaymentAttachment)
|
||||||
companyRouter.GET("/payment-accounts", servePaymentAccountIndex)
|
companyRouter.GET("/payment-accounts", servePaymentAccountIndex)
|
||||||
companyRouter.POST("/payment-accounts", handleAddPaymentAccount)
|
companyRouter.POST("/payment-accounts", handleAddPaymentAccount)
|
||||||
|
|
Loading…
Reference in New Issue