1
0
Fork 0

feat(backend): Added newsletter subscriptions

This commit is contained in:
joostdecock 2023-08-05 18:42:52 +02:00
parent 9460d98f6a
commit 2210f26e03
176 changed files with 1728 additions and 629 deletions

View file

@ -302,10 +302,17 @@ Backend.prototype.sendLanguageSuggestion = async function (data) {
}
/*
* Create payment intent
* Confirm newsletter subscribe
*/
Backend.prototype.createPaymentIntent = async function (data) {
return responseHandler(await api.post(`/payments/intent`, data), 201)
Backend.prototype.confirmNewsletterSubscribe = async function ({ id, ehash }) {
return responseHandler(await api.put('/subscriber', { id, ehash }))
}
/*
* Confirm newsletter unsubscribe
*/
Backend.prototype.confirmNewsletterUnsubscribe = async function ({ id, ehash }) {
return responseHandler(await api.delete('/subscriber', { id, ehash }))
}
export function useBackend(token = false) {