Skip to content

validation of the fields of my entity with PUT REQUEST #45

@kevinG73

Description

@kevinG73

Hello ,
my problem it's with the validation of the fields of my entity.
Example:
in my class

  /**
  * @ORM \ Entity ()
  * @UniqueEntity (fields = {"locale", "title"})
  **/
  class CategoryTranslation extends AbstractTranslation

i used the UniqueEntity annotation to prevent using the same word more two times with same local value, with my POST requests there are not problem but when I try to use PUT requests
the bundle does not UPDATE the data, it removes the records to insert new values so I get this error :
"detail": "translations [fr] .locale: This value is already used."

when I send this json to my endpoint:

 {
   "translations": [
     {
       "title": "natures",
       "locale": "fr"
     },
      {
       "title": "nature",
       "locale": "en"
     }
   ]
}

someone can give any hints ?
thank you in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions