🔨 Refactors code
This commit is contained in:
+4
-4
@@ -16,7 +16,7 @@ use uuid::Uuid;
|
||||
pub fn index(
|
||||
offset: Option<i64>,
|
||||
limit: Option<i64>,
|
||||
auth: Authenticated,
|
||||
_auth: Authenticated,
|
||||
state: &State<AppState>,
|
||||
) -> Result<Json<Vec<TrackerDTO>>, Status> {
|
||||
let mut db = state.db.lock().unwrap();
|
||||
@@ -40,7 +40,7 @@ pub fn index(
|
||||
#[get("/<id>")]
|
||||
pub fn get(
|
||||
id: &str,
|
||||
auth: Authenticated,
|
||||
_auth: Authenticated,
|
||||
state: &State<AppState>,
|
||||
) -> Result<Json<TrackerDTO>, Status> {
|
||||
let mut db = state.db.lock().unwrap();
|
||||
@@ -62,7 +62,7 @@ pub fn get(
|
||||
}
|
||||
|
||||
#[post("/")]
|
||||
pub fn create(auth: Authenticated, state: &State<AppState>) -> Result<Json<TrackerDTO>, Status> {
|
||||
pub fn create(_auth: Authenticated, state: &State<AppState>) -> Result<Json<TrackerDTO>, Status> {
|
||||
let mut db = state.db.lock().unwrap();
|
||||
|
||||
let new = Tracker {
|
||||
@@ -85,7 +85,7 @@ pub fn create(auth: Authenticated, state: &State<AppState>) -> Result<Json<Track
|
||||
pub fn delete(
|
||||
id: &str,
|
||||
delete_hits: Option<bool>,
|
||||
auth: Authenticated,
|
||||
_auth: Authenticated,
|
||||
state: &State<AppState>,
|
||||
) -> Result<Status, Status> {
|
||||
let mut db = state.db.lock().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user