feat: Add notes for Contacts (#3273)

Fixes #2275
This commit is contained in:
Pranav Raj S 2021-10-25 18:35:58 +05:30 committed by GitHub
parent e5e73a08fe
commit 8e6ce3a813
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 416 additions and 278 deletions

View file

@ -2,7 +2,27 @@ import ApiClient from './ApiClient';
class ContactNotes extends ApiClient {
constructor() {
super('contact_notes', { accountScoped: true });
super('notes', { accountScoped: true });
this.contactId = null;
}
get url() {
return `${this.baseUrl()}/contacts/${this.contactId}/notes`;
}
get(contactId) {
this.contactId = contactId;
return super.get();
}
create(contactId, content) {
this.contactId = contactId;
return super.create({ content });
}
delete(contactId, id) {
this.contactId = contactId;
return super.delete(id);
}
}