fix: ads balance check

This commit is contained in:
trisua 2025-08-11 22:53:38 -04:00
parent 9a5236bc1b
commit 83971b3d20
3 changed files with 9 additions and 4 deletions

View file

@ -104,7 +104,12 @@ pub async fn update_is_running_request(
None => return Json(Error::NotAllowed.into()),
};
if user.coins < 50 {
let ad = match data.get_ad_by_id(id).await {
Ok(x) => x,
Err(e) => return Json(e.into()),
};
if !ad.is_running && user.coins < 50 {
return Json(
Error::MiscError(
"You must have a minimum of 50 coins in your balance to run ads".to_string(),