fix: 4 is always bigger than 0
This commit is contained in:
parent
027649a060
commit
53451e67c7
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
use axum::{body::Bytes, http::StatusCode};
|
use axum::body::Bytes;
|
||||||
use diesel::{
|
use diesel::{
|
||||||
ExpressionMethods, QueryDsl, Queryable, Selectable, SelectableHelper, delete, insert_into,
|
ExpressionMethods, QueryDsl, Queryable, Selectable, SelectableHelper, delete, insert_into,
|
||||||
update,
|
update,
|
||||||
|
@ -284,7 +284,7 @@ impl Me {
|
||||||
cache_pool: &redis::Client,
|
cache_pool: &redis::Client,
|
||||||
new_status: i16,
|
new_status: i16,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
if new_status > 4 && new_status < 0 {
|
if new_status > 4 || new_status < 0 {
|
||||||
return Err(Error::BadRequest("Invalid status code".to_string()));
|
return Err(Error::BadRequest("Invalid status code".to_string()));
|
||||||
}
|
}
|
||||||
self.online_status = new_status;
|
self.online_status = new_status;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue