UNPKG

lin3s-sylius-shop-api-client

Version:

JavaScript client on top of SyliusShopApiPlugin to build integrations with ease.

21 lines (17 loc) 516 B
import axios from 'axios'; import {contentTypeJson} from '../requestConfig'; export default config => ({password, token}) => new Promise((resolve, reject) => { const headers = { ...contentTypeJson(), }; const data = { password: { first: password, second: password, } }; axios.put(`${config.baseUrl}/shop-api/password-reset/${token}`, JSON.stringify(data), headers) .then(response => resolve(response.data)) .catch(error => reject(error)); });