Files
frontend-app-authn/src/welcome/data/service.js
2021-07-28 16:42:37 +05:00

19 lines
514 B
JavaScript

import { getConfig } from '@edx/frontend-platform';
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
export default async function patchAccount(username, commitValues) {
const requestConfig = {
headers: { 'Content-Type': 'application/merge-patch+json' },
};
await getAuthenticatedHttpClient()
.patch(
`${getConfig().LMS_BASE_URL}/api/user/v1/accounts/${username}`,
commitValues,
requestConfig,
)
.catch((error) => {
throw (error);
});
}