update db name
This commit is contained in:
+2
-2
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
// GET /quotes
|
||||
func getQuotes(w http.ResponseWriter, r *http.Request) {
|
||||
rows, err := db.Query(context.Background(), "SELECT * FROM quotes")
|
||||
rows, err := db.Query(context.Background(), "SELECT * FROM hlaskovnik")
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), 500)
|
||||
return
|
||||
@@ -41,7 +41,7 @@ func createQuote(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
err = db.QueryRow(
|
||||
context.Background(),
|
||||
"INSERT INTO quotes(author, body) VALUES($1, $2) RETURNING id",
|
||||
"INSERT INTO hlaskovnik(author, body) VALUES($1, $2) RETURNING id",
|
||||
q.Author, q.Body,
|
||||
).Scan(&q.Id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user