Move to string ordId

This commit is contained in:
Owen Schwartz 2024-10-14 15:11:18 -04:00
parent 0f3dada6cc
commit 9abb656d52
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
16 changed files with 28 additions and 26 deletions

View file

@ -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'));
}