setFriendInfo method

Future setFriendInfo(
  1. Map<String, dynamic> params
)

Implementation

Future<dynamic> setFriendInfo(Map<String, dynamic> params) async {
  try {
    final formateParams = mapToJSObj({
      "userID": params["userID"],
      "remark": params["friendRemark"],
      "friendCustomField":
          FriendInfo.formateFriendCustomInfo(params["friendCustomInfo"])
    });
    final res =
        await wrappedPromiseToFuture(timeWeb!.updateFriend(formateParams));
    if (res.code == 0) {
      return CommonUtils.returnSuccessForCb(null);
    } else {
      return CommonUtils.returnError(
          "getFriendsInfo faile code:${res.code}, data:${res.data}");
    }
  } catch (error) {
    return CommonUtils.returnError(error);
  }
}