mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
update password function
This commit is contained in:
16
scm-ui/src/users/components/updatePassword.js
Normal file
16
scm-ui/src/users/components/updatePassword.js
Normal 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 };
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user