Rename to bmarket

This commit is contained in:
ekzyis 2023-09-09 22:52:50 +02:00
parent e14a3c824d
commit 5ffc35a94f
4 changed files with 4 additions and 4 deletions

View File

@ -78,6 +78,6 @@
{{ end }} {{ end }}
</div> </div>
</body> </body>
<script src="/market.js"></script> <script src="/bmarket.js"></script>
</html> </html>

View File

@ -196,7 +196,7 @@ func logout(c echo.Context) error {
return c.Redirect(http.StatusSeeOther, "/") return c.Redirect(http.StatusSeeOther, "/")
} }
func market(c echo.Context) error { func bmarket(c echo.Context) error {
marketId := c.Param("id") marketId := c.Param("id")
var market Market var market Market
err := db.QueryRow("SELECT id, description FROM markets WHERE id = $1 AND active = true", marketId).Scan(&market.Id, &market.Description) err := db.QueryRow("SELECT id, description FROM markets WHERE id = $1 AND active = true", marketId).Scan(&market.Id, &market.Description)
@ -222,7 +222,7 @@ func market(c echo.Context) error {
"Description": market.Description, "Description": market.Description,
"Shares": shares, "Shares": shares,
} }
return c.Render(http.StatusOK, "binary_market.html", data) return c.Render(http.StatusOK, "bmarket.html", data)
} }
func marketCost(c echo.Context) error { func marketCost(c echo.Context) error {

View File

@ -63,7 +63,7 @@ func main() {
e.GET("/api/login", verifyLogin) e.GET("/api/login", verifyLogin)
e.GET("/api/session", checkSession) e.GET("/api/session", checkSession)
e.POST("/logout", logout) e.POST("/logout", logout)
e.GET("/market/:id", sessionGuard(market)) e.GET("/market/:id", sessionGuard(bmarket))
e.POST("/api/market/:id/cost", sessionGuard(marketCost)) e.POST("/api/market/:id/cost", sessionGuard(marketCost))
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{ e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
Format: "${time_custom} ${method} ${uri} ${status}\n", Format: "${time_custom} ${method} ${uri} ${status}\n",