added integration tests and added message with attachments
This commit is contained in:
+2
-5
@@ -13,7 +13,7 @@ use crate::{
|
||||
routes::users::UserProfile,
|
||||
};
|
||||
|
||||
#[derive(sqlx::FromRow, serde::Serialize)]
|
||||
#[derive(sqlx::FromRow, serde::Serialize, serde::Deserialize)]
|
||||
pub struct Room {
|
||||
pub uuid: Uuid,
|
||||
pub name: String,
|
||||
@@ -60,7 +60,7 @@ pub fn routes() -> Router {
|
||||
.route("/rooms", get(list_rooms))
|
||||
.route("/rooms", post(create_room))
|
||||
.route("/rooms/{room_uuid}", get(get_room))
|
||||
.route("/rooms/{room-uuid}/members", get(list_members))
|
||||
.route("/rooms/{room_uuid}/members", get(list_members))
|
||||
.route("/rooms/invites", get(list_invites))
|
||||
.route("/rooms/invite", post(send_invite))
|
||||
.route("/rooms/join", post(accept_request))
|
||||
@@ -95,9 +95,6 @@ async fn list_rooms(
|
||||
Extension(db): Extension<PgPool>,
|
||||
) -> Result<Json<Vec<Room>>, APIError> {
|
||||
let claims = verify_jwt(headers)?;
|
||||
if claims.sub != claims.sub {
|
||||
return Err(APIError::InvalidToken);
|
||||
}
|
||||
|
||||
let user_id = user_id_from_uuid(&db, claims.sub).await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user