Have basic newsletter subscribe form working

This commit is contained in:
fragosti
2018-06-01 11:04:56 -07:00
parent 484fd68495
commit 3a7f26f620
6 changed files with 93 additions and 2 deletions

View File

@@ -20,6 +20,18 @@ export const fetchUtils = {
const result = await response.json();
return result;
},
async postAsync(baseUrl: string, path: string, body: object): Promise<Response> {
const url = `${baseUrl}${path}`;
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
return response;
},
};
function queryStringFromQueryParams(queryParams?: object): string {