summaryrefslogtreecommitdiffstats
path: root/src/warning/routes.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-10-17 20:33:26 +0000
committerSanto Cariotti <santo@dcariotti.me>2022-10-17 20:33:26 +0000
commitfc296356c4e1b269fd55196e72791ea3fbf03b08 (patch)
tree14555014d9297eb6716801bd40acf5c65aa72e79 /src/warning/routes.rs
parent74976dab57887a4d7e29b426cdf7422722fa58ee (diff)
Undo warning resolve
Diffstat (limited to 'src/warning/routes.rs')
-rw-r--r--src/warning/routes.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/warning/routes.rs b/src/warning/routes.rs
index 81173e6..e57b8a8 100644
--- a/src/warning/routes.rs
+++ b/src/warning/routes.rs
@@ -101,7 +101,11 @@ async fn edit_warning(
return Err(AppError::Unauthorized);
}
- warning.edit(user.id, payload).await?;
+ if payload.resolved_by.is_none() || payload.resolved_by.unwrap() {
+ warning.edit(Some(user.id), payload).await?;
+ } else {
+ warning.edit(None, payload).await?;
+ }
Ok(Json(warning))
}