get sale
This commit is contained in:
		@ -379,3 +379,9 @@ func (app *application) AllSubscriptions(w http.ResponseWriter, r *http.Request)
 | 
			
		||||
		app.errorLog.Println(err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (app *application) ShowSale(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
	if err := app.renderTemplate(w, r, "sale", &templateData{}); err != nil {
 | 
			
		||||
		app.errorLog.Println(err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -17,6 +17,7 @@ func (app *application) routes() http.Handler {
 | 
			
		||||
		mux.Get("/virtual-terminal", app.VirtualTerminal)
 | 
			
		||||
		mux.Get("/all-sales", app.AllSales)
 | 
			
		||||
		mux.Get("/all-subscriptions", app.AllSubscriptions)
 | 
			
		||||
		mux.Get("/sales/{id}", app.ShowSale)
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	// mux.Post("/virtual-terminal-payment-succeeded", app.VirtualTerminalPaymentSucceeded)
 | 
			
		||||
 | 
			
		||||
@ -23,7 +23,7 @@ All Subscriptions
 | 
			
		||||
 | 
			
		||||
{{define "js"}}
 | 
			
		||||
<script type="module">
 | 
			
		||||
    import {showTable} from "/static/js/all-sales.js"
 | 
			
		||||
    import {showTable} from "/static/js/all-subscriptions.js"
 | 
			
		||||
    showTable({{.API}});
 | 
			
		||||
</script>
 | 
			
		||||
{{end}}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										16
									
								
								cmd/web/templates/sale.page.gohtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								cmd/web/templates/sale.page.gohtml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,16 @@
 | 
			
		||||
{{template "base" .}}
 | 
			
		||||
 | 
			
		||||
{{define "title"}}
 | 
			
		||||
Sale
 | 
			
		||||
{{end}}
 | 
			
		||||
{{define "content"}}
 | 
			
		||||
<h2 class="mt-5">Sale</h2>
 | 
			
		||||
<hr>
 | 
			
		||||
{{end}}
 | 
			
		||||
 | 
			
		||||
{{define "js"}}
 | 
			
		||||
<script type="module">
 | 
			
		||||
    import {showInfo} from "/static/js/sale.js"
 | 
			
		||||
    showInfo({{.API}});
 | 
			
		||||
</script>
 | 
			
		||||
{{end}}
 | 
			
		||||
		Reference in New Issue
	
	Block a user