/* eslint-disable import/prefer-default-export */

import { SubmissionError } from 'redux-form';

import {
  /* SUBMIT_MESSAGE_START,
  SUBMIT_MESSAGE_SUCCESS,
  SUBMIT_MESSAGE_FAIL,
  SUBMIT_MESSAGE_ERROR,*/
} from '../constants';


export const submitMessage = async data => {
  try {
    const response = await fetch(
      'https://formspree.io/form@adamdabrowski.com',
      {
        headers: { Accept: 'application/json' },
        method: 'POST',
        data,
      },
    );
    if (response.ok) {
      return true;
    } else if (response.status === 400) {
      throw new SubmissionError(response.statusText);
    } else {
      throw response.status;
    }
  } catch (error) {
    throw error;
  }
};

@@ -230,37 +230,23 @@
 ';%0A%0A
-%0Aexport const submitMessage =
+const formspree
  asy
@@ -694,8 +694,159 @@
 %0A  %7D%0A%7D;%0A
+%0Aexport const submitMessage = return formspree(data)%0A  .then(resolved =%3E resolved, rejected =%3E %7B throw rejected %7D)%0A  .catch(error =%3E %7B throw error %7D);%0A

Fix contact.js ~