Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backend/src/entities/company-info/company-info.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
BadRequestException,
Body,
Controller,
Delete,
Expand Down Expand Up @@ -336,6 +337,9 @@ export class CompanyInfoController {
@UserId() userId: string,
@Query('displayMode') displayMode: string,
): Promise<SuccessResponse> {
if (displayMode !== 'on' && displayMode !== 'off') {
throw new BadRequestException(Messages.INVALID_DISPLAY_MODE);
}
const newDisplayMode = displayMode === 'on';
const inputData: ToggleTestConnectionDisplayModeDs = {
userId,
Expand Down
4 changes: 4 additions & 0 deletions backend/src/entities/user/user.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
BadRequestException,
Body,
Controller,
Get,
Expand Down Expand Up @@ -480,6 +481,9 @@ export class UserController {
@UserId() userId: string,
@Query('displayMode') displayMode: string,
): Promise<SuccessResponse> {
if (displayMode !== 'on' && displayMode !== 'off') {
throw new BadRequestException(Messages.INVALID_DISPLAY_MODE);
}
const newDisplayMode = displayMode === 'on';
const toggleConnectionDisplayModeDs = {
userId: userId,
Expand Down
1 change: 1 addition & 0 deletions backend/src/exceptions/text/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export const Messages = {
INCORRECT_TABLE_LOG_ACTION_TYPE: `Incorrect log operation type, supported types are ${enumToString(
LogOperationTypeEnum,
)}`,
INVALID_DISPLAY_MODE: `Invalid display mode. Supported values are "on" and "off"`,
INVALID_USERNAME_OR_PASSWORD: `Username or password is invalid`,
INVALID_USER_COMPANY_ROLE: `Invalid user role in company. Only supported is ${enumToString(UserRoleEnum)}`,
INVALID_JWT_TOKEN: `JWT token syntax is invalid`,
Expand Down
Loading