[x] There is a backend PUT endpoint /api/chat/hide with param id where any user can "hide" any of their own messages; however the message should not be permanently deleted, but rather just "marked as hidden" by setting hidden to true. The endpoint should return 403 if (the message doesn't belong to the user AND the user is not an admin). If the opposite of that is true, i.e. (message belongs to user OR user is an admin), then the message will be marked as hidden. This should also invalidate the React Query cache for /api/chat/get and force a refresh of the chat window.
[x] There is a backend endpoint /api/chat/admin/hidden (param commonsId) for the Admin only that retrieves all hidden messages for a given commons (paged).
[x] There is a backend endpoint /api/chat/admin/get (param commonsId) for the Admin that retrieves all messages for a given commons including hidden ones (paged).
Specifications