#66 set minimum

This commit is contained in:
2022-11-12 13:42:09 +01:00
parent 0db3ef4a1f
commit 9d13e607f5
2 changed files with 3 additions and 2 deletions

View File

@@ -49,7 +49,7 @@ async fn create(note: web::Json<Note>) -> impl Responder {
}
match n.views {
Some(v) => {
if v > *config::MAX_VIEWS {
if v > *config::MAX_VIEWS || v < 1 {
return bad_req;
}
n.expiration = None; // views overrides expiration