update password function

This commit is contained in:
Maren Süwer
2018-11-05 16:14:54 +01:00
parent 4e444c1449
commit c6bc385b2f
4 changed files with 98 additions and 6 deletions

View File

@@ -0,0 +1,16 @@
//@flow
import { apiClient } from "@scm-manager/ui-components";
const CONTENT_TYPE_USER = "application/vnd.scmm-passwordOverwrite+json;v=2";
export function updatePassword(url: string, password: string) {
return apiClient
.put(url, { newPassword: password }, CONTENT_TYPE_USER)
.then(response => {
return {
status: response.status
};
})
.catch(err => {
return { error: err };
});
}