-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removing redundant class validators IsDefined and IsString (#2053)
Co-authored-by: Zack Lee <[email protected]> Co-authored-by: danoswaltCL <[email protected]>
- Loading branch information
1 parent
73b7150
commit 4e99647
Showing
25 changed files
with
27 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 2 additions & 6 deletions
8
backend/packages/Upgrade/src/api/controllers/validators/CaliperLogEnvelope.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
import { IsNotEmpty, IsDefined, IsString } from 'class-validator'; | ||
import { IsNotEmpty, IsString } from 'class-validator'; | ||
import { CaliperLogData } from './CaliperLogData'; | ||
|
||
|
||
export class CaliperLogEnvelope { | ||
@IsDefined() | ||
@IsNotEmpty() | ||
@IsString() | ||
public sensor: string; | ||
|
||
@IsDefined() | ||
@IsNotEmpty() | ||
@IsString() | ||
public sendTime: string; | ||
|
||
@IsDefined() | ||
@IsNotEmpty() | ||
@IsString() | ||
public dataVersion: string; | ||
|
||
public data: CaliperLogData[]; | ||
} | ||
} |
4 changes: 1 addition & 3 deletions
4
backend/packages/Upgrade/src/api/controllers/validators/DataExportValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import { IsNotEmpty, IsString, IsDefined } from 'class-validator'; | ||
import { IsNotEmpty, IsString } from 'class-validator'; | ||
|
||
export class DataExportValidator { | ||
@IsString() | ||
@IsNotEmpty() | ||
@IsDefined() | ||
public experimentId: string; | ||
|
||
@IsString() | ||
@IsNotEmpty() | ||
@IsDefined() | ||
public email: string; | ||
} |
5 changes: 2 additions & 3 deletions
5
backend/packages/Upgrade/src/api/controllers/validators/DataLogAnalysisValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import { IsNotEmpty, IsString, IsDefined, IsArray } from 'class-validator'; | ||
import { IsNotEmpty, IsString, IsArray } from 'class-validator'; | ||
|
||
export class DataLogAnalysisValidator { | ||
@IsString({each: true}) | ||
@IsString({ each: true }) | ||
@IsNotEmpty() | ||
@IsDefined() | ||
@IsArray() | ||
public queryIds: string[]; | ||
} |
4 changes: 1 addition & 3 deletions
4
backend/packages/Upgrade/src/api/controllers/validators/ExperimentAssignmentValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import { IsNotEmpty, IsDefined, IsString } from 'class-validator'; | ||
import { IsNotEmpty, IsString } from 'class-validator'; | ||
|
||
export class ExperimentAssignmentValidatorv6 { | ||
@IsNotEmpty() | ||
@IsDefined() | ||
@IsString() | ||
public context: string; | ||
} | ||
|
||
export class ExperimentAssignmentValidator extends ExperimentAssignmentValidatorv6 { | ||
@IsNotEmpty() | ||
@IsDefined() | ||
@IsString() | ||
public userId: string; | ||
} |
3 changes: 1 addition & 2 deletions
3
backend/packages/Upgrade/src/api/controllers/validators/ExperimentIdsValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import { IsArray, IsNotEmpty, IsString, IsUUID } from 'class-validator'; | ||
import { IsArray, IsNotEmpty, IsUUID } from 'class-validator'; | ||
|
||
export class ExperimentIds { | ||
@IsArray() | ||
@IsNotEmpty() | ||
@IsString({ each: true }) | ||
@IsUUID('all', { each: true }) | ||
public ids: string[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
backend/packages/Upgrade/src/api/controllers/validators/FailedParamsValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
backend/packages/Upgrade/src/api/controllers/validators/ScheduledJobsParamsValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import { IsNotEmpty, IsDefined } from 'class-validator'; | ||
import { IsNotEmpty } from 'class-validator'; | ||
|
||
export class ScheduledJobsParamsValidator { | ||
@IsNotEmpty() | ||
@IsDefined() | ||
public id: string; | ||
} |
Oops, something went wrong.