Add eslint rule and fix as many issues as possible

This commit is contained in:
Khoa Le
2023-06-19 23:42:04 -04:00
parent e9eacc445d
commit 9d33e4756b
689 changed files with 9446 additions and 21821 deletions
@@ -1,8 +1,8 @@
import { Request, Response, NextFunction } from 'express';
import { Types } from 'mongoose';
import { validateClientForOrganization } from '../validation';
import { NextFunction, Request, Response } from "express";
import { Types } from "mongoose";
import { validateClientForOrganization } from "../validation";
type req = 'params' | 'body' | 'query';
type req = "params" | "body" | "query";
/**
* Validate if user on request is a member with proper roles for organization
@@ -14,10 +14,10 @@ type req = 'params' | 'body' | 'query';
const requireOrganizationAuth = ({
acceptedRoles,
acceptedStatuses,
locationOrganizationId = 'params'
locationOrganizationId = "params",
}: {
acceptedRoles: Array<'owner' | 'admin' | 'member'>;
acceptedStatuses: Array<'invited' | 'accepted'>;
acceptedRoles: Array<"owner" | "admin" | "member">;
acceptedStatuses: Array<"invited" | "accepted">;
locationOrganizationId?: req;
}) => {
return async (req: Request, res: Response, next: NextFunction) => {
@@ -27,7 +27,7 @@ const requireOrganizationAuth = ({
authData: req.authData,
organizationId: new Types.ObjectId(organizationId),
acceptedRoles,
acceptedStatuses
acceptedStatuses,
});
if (organization) {