add: reactions
This commit is contained in:
parent
c46eb3b807
commit
382e3bc7a6
18 changed files with 357 additions and 11 deletions
|
@ -1,17 +1,23 @@
|
|||
pub mod auth;
|
||||
pub mod journal;
|
||||
pub mod reactions;
|
||||
|
||||
use axum::{
|
||||
Router,
|
||||
routing::{delete, get, post},
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use tetratto_core::model::journal::{
|
||||
JournalEntryContext, JournalPageReadAccess, JournalPageWriteAccess,
|
||||
use tetratto_core::model::{
|
||||
journal::{JournalEntryContext, JournalPageReadAccess, JournalPageWriteAccess},
|
||||
reactions::AssetType,
|
||||
};
|
||||
|
||||
pub fn routes() -> Router {
|
||||
Router::new()
|
||||
// reactions
|
||||
.route("/reactions", post(reactions::create_request))
|
||||
.route("/reactions/{id}", get(reactions::get_request))
|
||||
.route("/reactions/{id}", delete(reactions::delete_request))
|
||||
// journal pages
|
||||
.route("/pages", post(journal::pages::create_request))
|
||||
.route("/pages/{id}", delete(journal::pages::delete_request))
|
||||
|
@ -113,3 +119,9 @@ pub struct UpdateJournalEntryContent {
|
|||
pub struct UpdateJournalEntryContext {
|
||||
pub context: JournalEntryContext,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct CreateReaction {
|
||||
pub asset: usize,
|
||||
pub asset_type: AssetType,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue