0

I'm getting some errors from my backend which look similar to:

'errors': {
  'something.937db262-657c-4676-9526-c550dcb922d7.field1': ['Invalid value'],
  'something.937db262-657c-4676-9526-c550dcb922d7.field2': ['Invalid value', 'text too short'],
  'something.10411657-1947-49cc-ab9c-029163aeff85.field1': ['some other error']
}

But how do I convert it to this:

'errors': {
  'something': {
    '937db262-657c-4676-9526-c550dcb922d7': {
      'field1': ['Invalid value'],
      'field2': ['Invalid value', 'text too short']
    },
    '10411657-1947-49cc-ab9c-029163aeff85.field3' : {
      'field1': ['some other error']
    }
  }
}

I tried a lot of things but didn't get it to work yet.

Thank you!

2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.