Email subscription params in request body

This commit is contained in:
Eugene Orlov
2023-06-29 10:52:36 -05:00
committed by Umputun
parent 136d7e8215
commit 6410e3be85
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -73,13 +73,13 @@ export const uploadImage = (image: File): Promise<Image> => {
* @param emailAddress email for subscription
*/
export const emailVerificationForSubscribe = (emailAddress: string) =>
apiFetcher.post('/email/subscribe', { address: emailAddress });
apiFetcher.post('/email/subscribe', {}, { address: emailAddress });
/**
* Confirmation of email subscription to updates
* @param token confirmation token from email
*/
export const emailConfirmationForSubscribe = (token: string) => apiFetcher.post('/email/confirm', { tkn: token });
export const emailConfirmationForSubscribe = (token: string) => apiFetcher.post('/email/confirm', {}, { token });
/**
* Decline current subscription to updates
+1 -1
View File
@@ -59,7 +59,7 @@ const createFetcher = (baseUrl: string = ''): Methods => {
params.body = body;
} else if (typeof body === 'object' && body !== null) {
headers['Content-Type'] = 'application/json';
params.body = JSON.stringify(body);
params.body = JSON.stringify({ ...body, site: siteId });
} else {
params.body = body;
}