kbss-cvut / s-pipes-editor-ui

MIT License
0 stars 0 forks source link

Axios api #87

Closed palagdan closed 1 week ago

palagdan commented 1 week ago

Resolve #86

palagdan commented 1 week ago

@blcham

Regarding your comment about the JSON-LD-based API, I don't think there are any issues with the migration to Axios.

The goal of this ticket was to remove things like (res) => res.json() and result => return result;, and to create a single API instance that can be configurable.

For example, this:

return fetch("/rest/execution/history-modules", postRequestOptions)
      .then((res) => res.json())
      .then((result) => {
        return result;
      });

Now it is just:

  return postFetcher(URLs.EXECUTION_HISTORY_MODULES, data);

I tested the application and it works as before.