mark read backend

This commit is contained in:
2023-10-29 17:06:19 +01:00
parent 1789458830
commit abf9a1b818
5 changed files with 53 additions and 11 deletions
+1
View File
@@ -3,6 +3,7 @@ pub mod login;
pub mod new_feed;
pub mod new_feed_item;
pub mod new_user;
pub mod read_feed_item;
pub mod readable;
pub mod url;
pub mod user;
+6
View File
@@ -0,0 +1,6 @@
use serde_derive::Deserialize;
#[derive(Deserialize)]
pub struct ReadItem {
pub id: i32,
}
+8
View File
@@ -0,0 +1,8 @@
use actix_web::{web, HttpRequest, HttpResponse, Responder};
use crate::json_serialization::read_feed_item::ReadItem;
pub async fn mark_read(_req: HttpRequest, path: web::Path<ReadItem>) -> impl Responder {
log::info!("Id: {}", path.id);
HttpResponse::Ok()
}
+5
View File
@@ -4,6 +4,7 @@ use crate::views::path::Path;
mod add;
pub mod feeds;
mod get;
mod mark_read;
mod read;
mod scraper;
pub mod structs;
@@ -30,4 +31,8 @@ pub fn feed_factory(app: &mut web::ServiceConfig) {
&base_path.define(String::from("/read")),
actix_web::Route::to(web::post(), read::read),
);
app.route(
&base_path.define(String::from("/read/{id}")),
actix_web::Route::to(web::put(), mark_read::mark_read),
);
}