First draft for push notifications

This commit is contained in:
Yannick Funk
2021-09-01 21:52:24 +02:00
parent 17a378494c
commit 697132082a
2 changed files with 74 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ use serde::{Deserialize, Serialize};
use crate::database::*;
use crate::util::result::{Error, Result};
use crate::util::variables::AUTUMN_URL;
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(tag = "type")]
@@ -112,4 +113,8 @@ impl File {
with: "attachment",
})
}
pub fn get_autumn_url(&self) -> String {
format!("{}/{}/{}", AUTUMN_URL.as_str(), self.tag, self.id)
}
}