undo
This commit is contained in:
parent
8dab4d3eee
commit
3d0aad3de1
1 changed files with 2 additions and 2 deletions
|
|
@ -32,7 +32,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.route("/api/customers.tp/{id}", get(get_customer))
|
.route("/api/customers/{id}", get(get_customer))
|
||||||
.with_state(state);
|
.with_state(state);
|
||||||
|
|
||||||
// run our app with hyper, listening globally on port 3000
|
// run our app with hyper, listening globally on port 3000
|
||||||
|
|
@ -53,7 +53,7 @@ async fn get_customer(
|
||||||
let rows = state
|
let rows = state
|
||||||
.db
|
.db
|
||||||
.query(
|
.query(
|
||||||
"SELECT id, first_name, last_name FROM customers.tp WHERE id = $1",
|
"SELECT id, first_name, last_name FROM customers WHERE id = $1",
|
||||||
&[&id],
|
&[&id],
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue