fix: mark all notifications as read/unread

fix: check profile status, warning, and biography length
fix: check post warning and tags length
This commit is contained in:
trisua 2025-05-28 13:06:48 -04:00
parent 3f6f1eda9f
commit 013bc0b45f
4 changed files with 54 additions and 8 deletions

View file

@ -289,6 +289,16 @@ pub async fn update_context_request(
None => return Json(Error::NotAllowed.into()),
};
// check lengths
if req.context.tags.len() > 512 {
return Json(Error::DataTooLong("tags".to_string()).into());
}
if req.context.content_warning.len() > 512 {
return Json(Error::DataTooLong("warning".to_string()).into());
}
// ...
match data.update_post_context(id, user, req.context).await {
Ok(_) => Json(ApiReturn {
ok: true,