Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Problem Statement :  

            AS page api is constructed with list of sections. So before creating page user need to first create sections and then associate those sections with page.

Most of the time user is doing section settings with invalid data type and that will cause page api issues.


Proposed Solution 1:

 During section create or update time , system will do the section data type validation, in case  section query is not valid then it won't allow to create it. 

Incorrect Section settings
 {
                "display": "{\"name\":{\"en\":\"Popular Story\",\"hi\":\"लोकप्रिय कहानी\"}}}",
                "alt": null,
                "description": null,
                "sectionDataType": "content",
                "imgUrl": null,
                "searchQuery": "{\"request\":{\"query\":\"\",\"filters\":{\"language\":[\"English\"],\"contentType\":[\"Story\"],\"status\":[\"Live\"]},\"sort_by\":{\"me_averageRating\":\"desc\"},\"limit\":10,\"exists\":[\"me_averageRating\"]}}",
                "name": "Popular Story"
            }


Or 

{
                "display": "{\\"name\\":{\\"en\\":\\"Popular Story\\"}}}",
                "alt": null,
                "description": null,
                "sectionDataType": "content",
                "imgUrl": null,
                "searchQuery": "{\\"request\\":{\\"query\\":\\"\\",\\"filters\\":{\\"language\\":[\\"English\\"],\\"contentType\\":[\\"Story\\"],\\"status\\":[\\"Live\\"]},\\"sort_by\\":{\\"me_averageRating\\":\\"desc\\"},\\"limit\\":10,\\"exists\\":[\\"me_averageRating\\"]}}",
                "name": "Popular Story"
            }
Correct syntax for section
{
"request":{
		"name": "Featured Content",
		"sectionDataType": "content",
		"display": {
			"name":{
				"en":"Featured Content"
			}
		},
		"searchQuery": {
			"request":{
				"filters":{
					"contentType":["Course","TextBook","Resource"],
					"status":["Live"]
				},
				"sort_by":{"me_averageRating":"desc"},
				"limit":10
			}
		}
    }
}
  • No labels