class-validator#isNotEmpty TypeScript Examples

The following examples show how to use class-validator#isNotEmpty. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: utils.ts    From IBM-HyperProtectMBaaS with BSD 3-Clause "New" or "Revised" License 7 votes vote down vote up
/**
 * Checks if outcome exists in db
 * @param outcome
 */
export async function isOutcomeNew(outcome: OCKOutcome): Promise<boolean> {
  const outcomeExists = await getMongoRepository(OCKOutcome).findOne({
    taskUUID: outcome.taskUUID,
    taskOccurrenceIndex: outcome.taskOccurrenceIndex,
  });
  return isNotEmpty(outcomeExists);
}
Example #2
Source File: create-review.dto.ts    From edu-server with MIT License 6 votes vote down vote up
/**
   * The number of stars given in the review
   * @example 5
   */
  @IsNotEmpty()
  @IsNumber()
  @Max(5)
  @Min(0)
  stars: number;
Example #3
Source File: request-password-reset.dto.ts    From uniauth-backend with MIT License 6 votes vote down vote up
/** college email id of student  */
  @IsNotEmpty()
  @IsEmail()
  @ApiProperty({
    description: 'college email id of student ',
    example: '[email protected]',
    required: true,
  })
  email: string;
Example #4
Source File: classes.ts    From epicgames-freegames-node with MIT License 6 votes vote down vote up
/**
   * Unique identifier for the target chat or username of the target channel
   * @example -987654321
   * @example @channelusername
   * @env TELEGRAM_CHAT_ID
   */
  @IsString()
  @IsNotEmpty()
  chatId: string;
Example #5
Source File: AddTodo.ts    From remix-hexagonal-architecture with MIT License 5 votes vote down vote up
@IsString()
  @IsNotEmpty({ message: "The title of your todo is required." })
  @MaxLength(50, {
    message: "The title of your todo is limited to 50 characters.",
  })
  todoTitle!: string;
Example #6
Source File: EntityPageUpdateInput.ts    From amplication with Apache License 2.0 5 votes vote down vote up
@ValidateIf(o => !o.showAllFields)
  @IsNotEmpty()
  @Field(() => [String], {
    nullable: true,
    description: undefined
  })
  showFieldList?: string[];
Example #7
Source File: AddTodoList.ts    From remix-hexagonal-architecture with MIT License 5 votes vote down vote up
@IsString()
  @IsNotEmpty({ message: "The title of your todo list is required." })
  @MaxLength(50, {
    message: "The title of your todo list is limited to 50 characters.",
  })
  title!: string;
Example #8
Source File: create-collection.dto.ts    From aqualink-app with MIT License 5 votes vote down vote up
@ApiProperty({ example: 'La NiƱa heatwave 20/21' })
  @IsNotEmpty()
  @IsString()
  name: string;
Example #9
Source File: ChangePasswordCommand.ts    From test with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@IsNotEmpty()
  token: string
Example #10
Source File: KnowledgeVector.ts    From IBM-HyperProtectMBaaS with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Column()
  @IsString()
  @jsonMember
  @IsNotEmpty()
  id: string;
Example #11
Source File: classes.ts    From epicgames-freegames-node with MIT License 5 votes vote down vote up
/**
   * On the Gotify web UI, Apps > Create Application > reveal the token
   * @example SnL-wAvmfo_QT
   * @env GOTIFY_TOKEN
   */
  @IsNotEmpty()
  @IsString()
  token: string;
Example #12
Source File: acct-verification.dto.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
@IsNotEmpty()
  tokenParamName: string;
Example #13
Source File: course-update.dto.ts    From edu-server with MIT License 5 votes vote down vote up
/**
   * The level associated with the course
   * @example BEGINNER
   */
  @IsNotEmpty()
  @IsEnum(courseLevelType)
  courseLevel: courseLevelType;
Example #14
Source File: stage.dto.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
@MaxLength(columnSize.length256)
  @IsNotEmpty()
  @Expose()
  title: string;
Example #15
Source File: create-announcement.dto.ts    From edu-server with MIT License 5 votes vote down vote up
/**
   * The title of the announcement
   * @example 'New course on Web Development'
   */
  @IsNotEmpty()
  @IsString()
  title: string;