Skip to content

Commit

Permalink
refactor: changed error messages to follow error-xxxx pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandernsilva committed Feb 4, 2025
1 parent ca8f84c commit 86e48fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/meteor/app/api/server/v1/rooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -979,17 +979,17 @@ API.v1.addRoute(
const user = await Users.findOneById(this.userId, { projections: { username: 1 } });

if (!user) {
return API.v1.failure('Invalid user');
return API.v1.failure('error-invalid-user');
}

const subscription = await Subscriptions.findOneByRoomIdAndUserId(roomId, this.userId);

if (!subscription) {
return API.v1.failure(`The user is not subscribed to the room`);
return API.v1.failure(`error-invalid-subscription`);
}

if (!subscription.open) {
return API.v1.failure(`The room, ${subscription.name}, is already closed`);
return API.v1.failure('error-room-already-closed');
}

await hideRoomMethod(this.userId, roomId);
Expand Down

0 comments on commit 86e48fa

Please sign in to comment.