Skip to content

Commit dd8744f

Browse files
chore(backend): cleanup code quality issues (hoppscotch#5466)
Co-authored-by: jamesgeorge007 <[email protected]>
1 parent 1b0a21a commit dd8744f

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

packages/hoppscotch-backend/src/auth/auth.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { RTCookie } from 'src/decorators/rt-cookie.decorator';
2222
import { AuthProvider, authCookieHandler, authProviderCheck } from './helper';
2323
import { GoogleSSOGuard } from './guards/google-sso.guard';
2424
import { GithubSSOGuard } from './guards/github-sso.guard';
25-
import { MicrosoftSSOGuard } from './guards/microsoft-sso-.guard';
25+
import { MicrosoftSSOGuard } from './guards/microsoft-sso.guard';
2626
import { ThrottlerBehindProxyGuard } from 'src/guards/throttler-behind-proxy.guard';
2727
import { SkipThrottle } from '@nestjs/throttler';
2828
import { AUTH_PROVIDER_NOT_SPECIFIED } from 'src/errors';

packages/hoppscotch-backend/src/auth/guards/microsoft-sso-.guard.ts renamed to packages/hoppscotch-backend/src/auth/guards/microsoft-sso.guard.ts

File renamed without changes.

packages/hoppscotch-backend/src/errors.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ export const ADMIN_CAN_NOT_BE_DELETED =
2222
* Token Authorization failed (Check 'Authorization' Header)
2323
* (GqlAuthGuard)
2424
*/
25-
export const AUTH_FAIL = 'auth/fail';
25+
export const AUTH_FAIL = 'auth/fail' as const;
2626

2727
/**
2828
* Invalid JSON
2929
* (Utils)
3030
*/
31-
export const JSON_INVALID = 'json_invalid';
31+
export const JSON_INVALID = 'json_invalid' as const;
3232

3333
/**
3434
* Auth Provider not specified
3535
* (Auth)
3636
*/
37-
export const AUTH_PROVIDER_NOT_SPECIFIED = 'auth/provider_not_specified';
37+
export const AUTH_PROVIDER_NOT_SPECIFIED = 'auth/provider_not_specified' as const;
3838

3939
/**
4040
* Email not provided by OAuth provider
@@ -168,7 +168,7 @@ export const TEAM_NOT_REQUIRED_ROLE = 'team/not_required_role' as const;
168168
* Team name validation failure
169169
* (TeamService)
170170
*/
171-
export const TEAM_NAME_INVALID = 'team/name_invalid';
171+
export const TEAM_NAME_INVALID = 'team/name_invalid' as const;
172172

173173
/**
174174
* Couldn't find the sync data from the user
@@ -432,47 +432,41 @@ export const USER_ENVIRONMENT_GLOBAL_ENV_DOES_NOT_EXISTS =
432432
*/
433433
export const USER_ENVIRONMENT_GLOBAL_ENV_EXISTS =
434434
'user_environment/global_env_already_exists' as const;
435-
/*
436435

437436
/**
438437
* User environment doesn't exist for the user
439438
* (UserEnvironmentsService)
440439
*/
441440
export const USER_ENVIRONMENT_ENV_DOES_NOT_EXISTS =
442441
'user_environment/user_env_does_not_exists' as const;
443-
/*
444442

445443
/**
446444
* Cannot delete the global user environment
447445
* (UserEnvironmentsService)
448446
*/
449447
export const USER_ENVIRONMENT_GLOBAL_ENV_DELETION_FAILED =
450448
'user_environment/user_env_global_env_deletion_failed' as const;
451-
/*
452449

453450
/**
454451
* User environment is not a global environment
455452
* (UserEnvironmentsService)
456453
*/
457454
export const USER_ENVIRONMENT_IS_NOT_GLOBAL =
458455
'user_environment/user_env_is_not_global' as const;
459-
/*
460456

461457
/**
462458
* User environment update failed
463459
* (UserEnvironmentsService)
464460
*/
465461
export const USER_ENVIRONMENT_UPDATE_FAILED =
466462
'user_environment/user_env_update_failed' as const;
467-
/*
468463

469464
/**
470465
* User environment invalid environment name
471466
* (UserEnvironmentsService)
472467
*/
473468
export const USER_ENVIRONMENT_INVALID_ENVIRONMENT_NAME =
474469
'user_environment/user_env_invalid_env_name' as const;
475-
/*
476470

477471
/**
478472
* User history not found

packages/hoppscotch-backend/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
1212
import { InfraTokenModule } from './infra-token/infra-token.module';
1313
import { NestExpressApplication } from '@nestjs/platform-express';
1414

15-
function setupSwagger(app, isProduction: boolean) {
15+
function setupSwagger(app: NestExpressApplication, isProduction: boolean): void {
1616
const swaggerDocPath = '/api-docs';
1717

1818
const config = new DocumentBuilder()

0 commit comments

Comments
 (0)