static getSections()

in public/video-ui/src/services/WorkflowApi.js [28:51]


  static getSections() {
    // timeout in case the user is not logged into Workflow
    const params = {
      url: `${WorkflowApi.workflowUrl}/api/sections`,
      crossOrigin: true,
      withCredentials: true
    };

    return pandaReqwest(params, 500).then(response => {
      return WorkflowApi._getResponseAsJson(response)
        .data.map(section =>
          Object.assign({}, section, {
            id: section.name,
            title: section.name,
            workflowId: section.id
          })
        )
        .sort((a, b) => {
          if (a.title.toLowerCase() < b.title.toLowerCase()) return -1;
          if (a.title.toLowerCase() > b.title.toLowerCase()) return 1;
          return 0;
        });
    });
  }