Skip to content

Commit

Permalink
time bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cupcakearmy committed May 8, 2021
1 parent 22b1c35 commit 4852804
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/note/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ async fn create(note: web::Json<Note>) -> impl Responder {
if e > 360 {
return bad_req;
}
n.expiration = Some(now() + (e * 60))
let expiration = now() + (e * 60);
n.expiration = Some(expiration);
}
_ => {}
}
Expand Down Expand Up @@ -89,8 +90,8 @@ async fn delete(path: web::Path<NotePath>) -> impl Responder {
}
match changed.expiration {
Some(e) => {
if e > now() {
store::del(&p.id.clone());
store::del(&p.id.clone());
if e < now() {
return HttpResponse::BadRequest().finish();
}
}
Expand Down

0 comments on commit 4852804

Please sign in to comment.