thank you clippy very cool
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
use actix_web::{
|
use actix_web::{
|
||||||
get,
|
get,
|
||||||
http::header::ContentType,
|
http::header::ContentType,
|
||||||
web::{self, Json},
|
web::{self},
|
||||||
HttpResponse, Responder,
|
HttpResponse, Responder,
|
||||||
};
|
};
|
||||||
use backend::{
|
use backend::{
|
||||||
@@ -86,7 +86,7 @@ async fn api_test() -> impl Responder {
|
|||||||
#[get("api/vehicle/{id}")]
|
#[get("api/vehicle/{id}")]
|
||||||
async fn api_vehicle(id: web::Path<String>) -> impl Responder {
|
async fn api_vehicle(id: web::Path<String>) -> impl Responder {
|
||||||
let id = id.into_inner();
|
let id = id.into_inner();
|
||||||
let fetched_vehicle_data = get_vehicle(&mut establish_connection(), String::from(id));
|
let fetched_vehicle_data = get_vehicle(&mut establish_connection(), id);
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
.content_type(ContentType::plaintext())
|
.content_type(ContentType::plaintext())
|
||||||
.insert_header(("Access-Control-Allow-Origin", "*"))
|
.insert_header(("Access-Control-Allow-Origin", "*"))
|
||||||
|
|||||||
Reference in New Issue
Block a user