mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
added changePassword
method
This commit is contained in:
parent
c552a6a345
commit
ae843cc840
@ -87,6 +87,25 @@ export default class User {
|
||||
return response
|
||||
}
|
||||
|
||||
static async changePassword(payload) {
|
||||
if (!User.bridge) {
|
||||
return false
|
||||
}
|
||||
|
||||
const { currentPassword, newPassword } = payload
|
||||
|
||||
const { data } = await app.api.customRequest("main", {
|
||||
method: "POST",
|
||||
url: "/self/update_password",
|
||||
data: {
|
||||
currentPassword,
|
||||
newPassword,
|
||||
}
|
||||
})
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
getData = async (payload, callback) => {
|
||||
const request = await User.bridge.get.user(undefined, { username: payload.username, _id: payload.user_id }, {
|
||||
parseData: false
|
||||
|
Loading…
x
Reference in New Issue
Block a user