Add frontend tests and other stuff
This commit is contained in:
parent
d28e765e39
commit
642dd8a80c
26 changed files with 730 additions and 85 deletions
27
backend/src/services/api.rs
Normal file
27
backend/src/services/api.rs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
use actix_web::{http::{header, header::ContentType, StatusCode}, get, post, put, web, Responder, HttpRequest, HttpResponse, cookie::Cookie};
|
||||
use chrono::Duration;
|
||||
use serde::Deserialize;
|
||||
use log::{debug, error, log_enabled, info, Level};
|
||||
|
||||
use super::Result;
|
||||
use crate::utils;
|
||||
use crate::consts;
|
||||
use crate::config::Config;
|
||||
use crate::user::User;
|
||||
use crate::model;
|
||||
use crate::data::{db, asynchronous};
|
||||
|
||||
#[put("/ron-api/set-title")]
|
||||
pub async fn set_title(req: HttpRequest, connection: web::Data<db::Connection>) -> Result<HttpResponse> {
|
||||
//req.app_config()
|
||||
let id = 1;
|
||||
let title = "XYZ".to_string();
|
||||
|
||||
//let recipes = connection.set_recipe_title_async(id, title).await?;
|
||||
|
||||
Ok(
|
||||
HttpResponse::Ok()
|
||||
.content_type("application/ron")
|
||||
.body("DATA")
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue