Source: services/api/filters/addFilter.js

  1. import { config } from "../../../Constants";
  2. /**
  3. * Creates a new user filter
  4. *
  5. * @param request is the request json body sent to the endpoint
  6. * @returns {Promise<any>} is the json data returned
  7. */
  8. export async function addFilter(request) {
  9. return fetch(config.url.API_URL + '/filters', {
  10. method: 'PUT',
  11. headers: {
  12. 'Content-Type': 'application/json',
  13. 'Accept': 'application/json',
  14. 'Origin': config.url.API_URL
  15. },
  16. body: JSON.stringify(request)
  17. })
  18. .then(data => data.json())
  19. }