import 'dart:convert';

import '../models/personal_information_model.dart';

import '../app/constant.dart';
import '../models/response_save_change_password_model.dart';
import 'base_repository.dart';

class ChangePasswordRepository extends BaseRepository {
  ChangePasswordRepository({required super.dio});

  Future<ResponseSaveChangePasswordModel> ubahPassword(
      {required String userID,
      required String oldPassword,
      required String newPassword}) async {
    final param = {
      "userid": userID,
      "old": oldPassword,
      "new": newPassword,
    };

    print(param);

    final url =
        "${Constant.baseUrl}/v1/courier/login/change_password/?userid=$userID&old=$oldPassword&new=$newPassword";
    final resp = await post(param: param, service: url);
    return ResponseSaveChangePasswordModel.fromJson(resp);
  }
}
