Skip to content

Commit

Permalink
working main
Browse files Browse the repository at this point in the history
  • Loading branch information
knoxy5467 committed Mar 27, 2024
1 parent 20c99ab commit ae9d440
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions server/src/api.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use actix_web::{
get,
web, HttpResponse, Responder, ResponseError, Result,
};
use actix_web::{get, web, HttpResponse, Responder, ResponseError, Result};
use common::backend::*;
use sea_orm::{entity::prelude::*, DbErr};
use std::fmt;
Expand Down Expand Up @@ -52,23 +49,21 @@ async fn get_task_request(
scripts: Vec::new(), //TODO 26mar24 Mrknox: implement scripts
last_edited: model.last_edited,
})),
None => {
Err(actix_web::error::ErrorNotFound("task not found by ID"))
}
None => Err(actix_web::error::ErrorNotFound("task not found by ID")),
}
}

/// get /tasks endpoint for retrieving some number of TaskShorts
#[get("/tasks")]
async fn get_tasks_request(req: web::Json<Vec<ReadTaskShortRequest>>) -> Result<impl Responder> {
// do diesel stuff here

Ok(web::Json(vec![ReadTaskShortResponse {
task_id: req[0].task_id,
name: "heyo".to_string(),
completed: false,
props: Vec::new(),
deps: Vec::new(),
scripts: Vec::new(),
last_edited: chrono::NaiveDateTime::default(),
}]))
}

0 comments on commit ae9d440

Please sign in to comment.