Skip to content

Commit ee8cb7e

Browse files
remove redundant logic and add minLength 1 to the Subscriptions GetOne Schema
1 parent d0fdd82 commit ee8cb7e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

apps/meteor/app/api/server/v1/subscriptions.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const SubscriptionsGetOneSchema = {
5555
properties: {
5656
roomId: {
5757
type: 'string',
58+
minLength: 1,
5859
},
5960
},
6061
required: ['roomId'],
@@ -200,10 +201,6 @@ const subscriptionsEndpoints = API.v1.get(
200201
async function action() {
201202
const { roomId } = this.queryParams;
202203

203-
if (!roomId) {
204-
return API.v1.failure("The 'roomId' param is required");
205-
}
206-
207204
return API.v1.success({
208205
subscription: await Subscriptions.findOneByRoomIdAndUserId(roomId, this.userId),
209206
});

0 commit comments

Comments
 (0)