Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Breaking change ? Unable to use String validate options on array of strings #251

Closed
neilime opened this issue Feb 25, 2019 · 3 comments
Closed

Comments

@neilime
Copy link

neilime commented Feb 25, 2019

An error occured after updating typegoose to last version : Type of phoneNumbers property is not a string.

Here is the errored property :

  @property({
    lowercase: true,
    required: [true, 'phone_numbers.error.required'],
  })
  public phoneNumbers: string[];

I have tried to use arrayProp :

  @arrayProp({
    items: String,
    lowercase: true,
    required: [true, 'api.model.agency.contact.phone_numbers.error.required'],
  })
  public phoneNumbers: string[];

But option lowercase is not defined in arrayProp options type.

I think that https://github.com/szokodiakos/typegoose/blob/master/src/prop.ts#L138 should accept array of string too

@hasezoey
Copy link
Contributor

i know this is old, but i am working on it currently at Automattic/mongoose#8012

This was referenced Jul 24, 2019
@hasezoey
Copy link
Contributor

Update from the mongoose issue:

@hasezoey
Copy link
Contributor

@Ben305 this can be closed in favor of typegoose/typegoose#29

@Ben305 Ben305 closed this as completed Oct 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants