mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-30 22:49:27 +02:00
Move to string ordId
This commit is contained in:
parent
0f3dada6cc
commit
9abb656d52
16 changed files with 28 additions and 26 deletions
|
@ -8,13 +8,13 @@ import { AuthenticatedRequest } from '@server/types/Auth';
|
|||
|
||||
export function verifyOrgAccess(req: Request, res: Response, next: NextFunction) {
|
||||
const userId = req.user!.userId; // Assuming you have user information in the request
|
||||
const orgId = parseInt(req.params.orgId);
|
||||
const orgId = req.params.orgId;
|
||||
|
||||
if (!userId) {
|
||||
return next(createHttpError(HttpCode.UNAUTHORIZED, 'User not authenticated'));
|
||||
}
|
||||
|
||||
if (isNaN(orgId)) {
|
||||
if (!orgId) {
|
||||
return next(createHttpError(HttpCode.BAD_REQUEST, 'Invalid organization ID'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue