fix: stacks manage page when user deletes profile

add: allow moderators to view deleted posts
This commit is contained in:
trisua 2025-05-16 16:09:21 -04:00
parent 4c26879d00
commit 81307752c2
14 changed files with 211 additions and 29 deletions

View file

@ -43,7 +43,7 @@ pub async fn update_name_request(
None => return Json(Error::NotAllowed.into()),
};
match data.update_stack_name(id, user, &req.name).await {
match data.update_stack_name(id, &user, &req.name).await {
Ok(_) => Json(ApiReturn {
ok: true,
message: "Stack updated".to_string(),
@ -65,7 +65,7 @@ pub async fn update_privacy_request(
None => return Json(Error::NotAllowed.into()),
};
match data.update_stack_privacy(id, user, req.privacy).await {
match data.update_stack_privacy(id, &user, req.privacy).await {
Ok(_) => Json(ApiReturn {
ok: true,
message: "Stack updated".to_string(),
@ -87,7 +87,7 @@ pub async fn update_mode_request(
None => return Json(Error::NotAllowed.into()),
};
match data.update_stack_mode(id, user, req.mode).await {
match data.update_stack_mode(id, &user, req.mode).await {
Ok(_) => Json(ApiReturn {
ok: true,
message: "Stack updated".to_string(),
@ -109,7 +109,7 @@ pub async fn update_sort_request(
None => return Json(Error::NotAllowed.into()),
};
match data.update_stack_sort(id, user, req.sort).await {
match data.update_stack_sort(id, &user, req.sort).await {
Ok(_) => Json(ApiReturn {
ok: true,
message: "Stack updated".to_string(),
@ -152,7 +152,7 @@ pub async fn add_user_request(
};
stack.users.push(other_user.id);
match data.update_stack_users(id, user, stack.users).await {
match data.update_stack_users(id, &user, stack.users).await {
Ok(_) => Json(ApiReturn {
ok: true,
message: "User added".to_string(),
@ -191,7 +191,7 @@ pub async fn remove_user_request(
None => return Json(Error::GeneralNotFound("user".to_string()).into()),
});
match data.update_stack_users(id, user, stack.users).await {
match data.update_stack_users(id, &user, stack.users).await {
Ok(_) => Json(ApiReturn {
ok: true,
message: "User removed".to_string(),