updateContact method

Future<Contact> updateContact(
  1. String id, {
  2. String? name,
  3. String? orgId,
  4. String? phone,
})

Implementation

Future<Contact> updateContact(String id,
    {String? name, String? orgId, String? phone}) async {
  var org = (await getContactById(id))
      .copyWith(name: name, organizationId: null, phone: phone);

  var res = await dio.post("/crm/contacts", data: org.toJson());
  return Contact.fromJson(res.data["contact"]);
}