mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-07-15 03:38:07 +00:00
Can create countdown timers
This commit is contained in:
src
@ -184,6 +184,16 @@ pub fn create_post(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
PostKind::POST_KIND_PDF(PostFile::new_from_created_file(&file)?)
|
||||
}
|
||||
|
||||
"countdown" => {
|
||||
let time_end = r.post_u64("time-end")?;
|
||||
|
||||
if time_end < time() {
|
||||
r.bad_request("You can not create countdown timer for past events!".to_string())?;
|
||||
}
|
||||
|
||||
PostKind::POST_KIND_COUNTDOWN(time_end)
|
||||
}
|
||||
|
||||
// TODO : add support for next types
|
||||
|
||||
_ => {
|
||||
|
Reference in New Issue
Block a user