huridocs/uwazi

View on GitHub
app/react/Pages/PagesAPI.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import api from 'app/utils/api';

export default {
  get(requestParams) {
    return api.get('pages', requestParams).then(response => response.json);
  },

  getById(requestParams) {
    return api.get('page', requestParams).then(response => response.json);
  },

  save(requestParams) {
    return api.post('pages', requestParams).then(response => response.json);
  },

  delete(requestParams) {
    return api.delete('pages', requestParams).then(response => response.json);
  },
};