core icon indicating copy to clipboard operation
core copied to clipboard

TemplateResource: saveNew endpoint is not validating the required fields

Open bryanboza opened this issue 2 years ago • 0 comments

We need to validate the required fields on this endpoint because right now we are unable to save a new endpoint without a theme, which is causing an error when you try to use it on a page. image

  • Also once you save the template without a theme, we don't have a way to change this in the UI, because when you edit the template the theme field is disabled. image

To Reproduce We are able to reproduce this in two ways: 1- Try to add a new template using the UI, just leave without selecting the theme drop-down, wich has a red (*) indicating that is a required field (this is calling the endpoint, but maybe we cold have a validation from UI)

2- Try to add a new theme using the template resource

Method: POST
URL: {{serverURL}}/api/v1/templates
BODY: 
{
    "title":"PostMan Test",
    "layout":{
        "header":true,
        "footer":true,
        "body":{"rows":[]},
        "sidebar":null,
        "title":"",
        "width":null
    }
}

Expected behavior We need to validate we are sending all the required fields in order to add a new template

Desktop (please complete the following information): Tested on release-22.07 // Docker // FF

bryanboza avatar Aug 03 '22 16:08 bryanboza