Skip to content

Commit

Permalink
add check to other function
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Fontanier committed Apr 3, 2024
1 parent 282fa31 commit 27873ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions front/lib/resources/membership_resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export class MembershipResource extends BaseResource<MembershipModel> {
roles,
transaction,
}: GetMembershipsOptions): Promise<MembershipResource[]> {
if (!workspace && !userIds?.length) {
throw new Error("At least one of workspace or userIds must be provided.");
}
const whereClause: WhereOptions<InferAttributes<MembershipModel>> = {
startAt: {
[Op.lte]: new Date(),
Expand Down

0 comments on commit 27873ea

Please sign in to comment.