add: ability to add user to stack through block list ui

This commit is contained in:
trisua 2025-06-22 21:07:35 -04:00
parent 8c969cd56f
commit 2a77c61bf2
10 changed files with 130 additions and 20 deletions

View file

@ -211,6 +211,10 @@ pub async fn add_user_request(
Err(e) => return Json(e.into()),
};
if stack.users.contains(&other_user.id) {
return Json(Error::MiscError("This user is already in this stack".to_string()).into());
}
stack.users.push(other_user.id);
// check number of stacks