mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-22 08:16:28 +00:00
time bug
This commit is contained in:
parent
22b1c35b3e
commit
4852804581
@ -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);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user