Add a post fuct

This commit is contained in:
aprilthepink 2024-05-04 17:54:11 +02:00
parent 4c020229e4
commit 8ac9f7bd4b
4 changed files with 80 additions and 25 deletions

View file

@ -31,15 +31,15 @@ pub struct DbPost {
#[serde(rename_all = "camelCase")]
pub struct Note {
#[serde(rename = "type")]
kind: NoteType,
id: ObjectId<post::Model>,
pub(crate) kind: NoteType,
pub(crate) id: ObjectId<post::Model>,
pub(crate) attributed_to: ObjectId<user::Model>,
#[serde(deserialize_with = "deserialize_one_or_many")]
pub(crate) to: Vec<Url>,
content: String,
in_reply_to: Option<ObjectId<post::Model>>,
tag: Vec<Mention>,
sensitive: bool,
pub(crate) content: String,
pub(crate) in_reply_to: Option<ObjectId<post::Model>>,
pub(crate) tag: Vec<Mention>,
pub(crate) sensitive: bool,
}
#[derive(Clone, Debug, Deserialize, Serialize)]