Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Don't require organization ID for memberships
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed May 12, 2019
1 parent 00d5a2a commit 7cdf593
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/rest/membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import { createEvent } from "../crud/event";

export const getMembershipDetailsForUser = async (
userId: number,
membershipId: number,
organizationId: number
membershipId: number
) => {
if (await can(userId, Authorizations.READ, "membership", membershipId))
return await getMembership(membershipId);
Expand Down
9 changes: 2 additions & 7 deletions src/routes/membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@ import { getOrganizationMemberDetails } from "../crud/membership";

export const routeMembershipGet = async (req: Request, res: Response) => {
const id = req.params.id;
const organizationId = req.params.organizationId;
if (!id || !organizationId) throw new Error(ErrorCode.MISSING_FIELD);
if (!id) throw new Error(ErrorCode.MISSING_FIELD);
res.json({
membership: await getMembershipDetailsForUser(
res.locals.token.id,
id,
organizationId
)
membership: await getMembershipDetailsForUser(res.locals.token.id, id)
});
};

Expand Down

0 comments on commit 7cdf593

Please sign in to comment.