Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nickviola committed Dec 1, 2023
1 parent 5f6f992 commit 451592e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
6 changes: 2 additions & 4 deletions backend/src/api/organizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ export const getByRegionId = wrapHandler(async (event) => {
where: { regionId: regionId }
});

if (result) {
if (result) {
return {
statusCode: 200,
body: JSON.stringify(result)
Expand Down Expand Up @@ -883,9 +883,7 @@ export const addUserV2 = wrapHandler(async (event) => {
// if (!isOrgAdmin(event, id)) return Unauthorized;

// Validate the body
const body = await validateBody(
NewOrganizationRoleBody, event.body
);
const body = await validateBody(NewOrganizationRoleBody, event.body);

// Connect to the database
await connectToDatabase();
Expand Down
6 changes: 3 additions & 3 deletions backend/src/api/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ export const getByRegionId = wrapHandler(async (event) => {
body: JSON.stringify(result)
};
}
return NotFound;
return NotFound;
});

/**
Expand Down Expand Up @@ -723,7 +723,7 @@ export const getByState = wrapHandler(async (event) => {
body: JSON.stringify(result)
};
}
return NotFound;
return NotFound;
});

// V2 Endpoints
Expand Down Expand Up @@ -756,7 +756,7 @@ export const getByState = wrapHandler(async (event) => {
export const getAllV2 = wrapHandler(async (event) => {
if (!isRegionalAdmin(event)) return Unauthorized;

const filterParams = {}
const filterParams = {};

if (event.query && event.query.state) {
filterParams['state'] = event.query.state;
Expand Down
17 changes: 4 additions & 13 deletions backend/src/tasks/syncdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,8 @@ const NUM_SAMPLE_ORGS = 10; // Number of sample orgs
const NUM_SAMPLE_DOMAINS = 10; // Number of sample domains per org
const PROB_SAMPLE_SERVICES = 0.5; // Higher number means more services per domain
const PROB_SAMPLE_VULNERABILITIES = 0.5; // Higher number means more vulnerabilities per domain
const SAMPLE_STATES = [
'VA',
'CA',
'CO'
]
const SAMPLE_REGIONIDS = [
'1',
'2',
'3'
]
const SAMPLE_STATES = ['VA', 'CA', 'CO']
const SAMPLE_REGIONIDS = ['1', '2', '3']

export const handler: Handler = async (event) => {
const connection = await connectToDatabase(false);
Expand Down Expand Up @@ -90,9 +82,8 @@ export const handler: Handler = async (event) => {
isPassive: false,
tags: [tag],
state: SAMPLE_STATES[Math.floor(Math.random() * SAMPLE_STATES.length)],
regionId: SAMPLE_REGIONIDS[
Math.floor(Math.random() * SAMPLE_REGIONIDS.length)
],
regionId:
SAMPLE_REGIONIDS[Math.floor(Math.random() * SAMPLE_REGIONIDS.length)],
}).save();
console.log(organization.name);
organizationIds.push(organization.id);
Expand Down

0 comments on commit 451592e

Please sign in to comment.