Skip to content

Commit

Permalink
feat: subadmin get all organisations with pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
kobiowuquadri committed Jul 24, 2024
1 parent 473464c commit 755caf5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/routes/organisation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Router from "express";
import { OrgController } from "../controllers/OrgController";
import { authMiddleware } from "../middleware";
import { authMiddleware, checkPermissions } from "../middleware";
import { validateOrgId } from "../middleware/organization.validation";
import { UserRole } from "../enums/userRoles";

const orgRouter = Router();
const orgController = new OrgController();
Expand All @@ -16,6 +17,6 @@ orgRouter.get("/organisations/:org_id", authMiddleware, validateOrgId,
orgController.getSingleOrg.bind(orgController),
);

orgRouter.get("/organisations", authMiddleware, orgController.getAllOrgs.bind(orgController))
orgRouter.get("/organisations", authMiddleware, checkPermissions([UserRole.SUPER_ADMIN]), orgController.getAllOrgs.bind(orgController))

export { orgRouter };

0 comments on commit 755caf5

Please sign in to comment.