setUserPassword method
Set the password of a user
userId The ID of the user to set the password for
newPassword The new password to set for the user
Implementation
Future<SuccessResponse> setUserPassword({
required String userId,
required String newPassword,
}) async {
try {
final response = await super.dio.post(
"/admin/set-user-password",
data: {"userId": userId, "newPassword": newPassword},
options: await super.getOptions(isTokenRequired: true),
);
return SuccessResponse.fromJson(response.data);
} catch (e) {
final message = getErrorMessage(e);
if (message == null) rethrow;
throw message;
}
}