@in.pulse-crm/sdk 2.9.2 → 2.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,7 +18,7 @@ export default class WhatsappClient extends ApiClient {
18
18
  getContactsWithCustomer(): Promise<WppContactWithCustomer[]>;
19
19
  getContacts(): Promise<WppContact[]>;
20
20
  createContact(name: string, phone: string, customerId?: number): Promise<WppContact>;
21
- updateContact(contactId: number, name: string, customerId: number | null): Promise<WppContact>;
21
+ updateContact(contactId: number, name: string, customerId?: number | null): Promise<WppContact>;
22
22
  deleteContact(contactId: number): Promise<void>;
23
23
  getSectors(): Promise<{
24
24
  id: number;
@@ -96,7 +96,8 @@ class WhatsappClient extends api_client_1.default {
96
96
  }
97
97
  async updateContact(contactId, name, customerId) {
98
98
  const url = `/api/whatsapp/contacts/${contactId}`;
99
- const body = { name, customerId };
99
+ const body = { name };
100
+ customerId !== undefined && (body["customerId"] = customerId);
100
101
  const { data: res } = await this.ax.put(url, body);
101
102
  return res.data;
102
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@in.pulse-crm/sdk",
3
- "version": "2.9.2",
3
+ "version": "2.9.3",
4
4
  "description": "SDKs for abstraction of api consumption of in.pulse-crm application",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -170,9 +170,11 @@ export default class WhatsappClient extends ApiClient {
170
170
  return res.data;
171
171
  }
172
172
 
173
- public async updateContact(contactId: number, name: string, customerId: number | null) {
173
+ public async updateContact(contactId: number, name: string, customerId?: number | null) {
174
174
  const url = `/api/whatsapp/contacts/${contactId}`;
175
- const body = { name, customerId };
175
+ const body: Record<string, any> = { name };
176
+
177
+ customerId !== undefined && (body["customerId"] = customerId);
176
178
 
177
179
  const { data: res } = await this.ax.put<DataResponse<WppContact>>(
178
180
  url,