Retrieve room id from the project when following/unfollowing

Previously, we were accidentally using the project id as the room id.
This commit is contained in:
Max Brunsfeld 2023-02-20 16:34:55 -08:00 committed by Julia
parent c75aca25b6
commit 0dc92bec5c
2 changed files with 23 additions and 7 deletions

View file

@ -1719,7 +1719,6 @@ async fn follow(
response: Response<proto::Follow>,
session: Session,
) -> Result<()> {
let room_id = RoomId::from_proto(request.project_id);
let project_id = ProjectId::from_proto(request.project_id);
let leader_id = request
.leader_id
@ -1751,7 +1750,7 @@ async fn follow(
let room = session
.db()
.await
.follow(room_id, project_id, leader_id, follower_id)
.follow(project_id, leader_id, follower_id)
.await?;
room_updated(&room, &session.peer);
@ -1759,7 +1758,6 @@ async fn follow(
}
async fn unfollow(request: proto::Unfollow, session: Session) -> Result<()> {
let room_id = RoomId::from_proto(request.project_id);
let project_id = ProjectId::from_proto(request.project_id);
let leader_id = request
.leader_id
@ -1784,7 +1782,7 @@ async fn unfollow(request: proto::Unfollow, session: Session) -> Result<()> {
let room = session
.db()
.await
.unfollow(room_id, project_id, leader_id, follower_id)
.unfollow(project_id, leader_id, follower_id)
.await?;
room_updated(&room, &session.peer);