For CRUD support, you need to implement your CRUD logic under each of the CRUD emitters:
public saveEmitter(options?:QueryOptions): Promise<any> {
return rp({
method: 'POST',
uri: 'https://api.example.com/myendpoint',
body:this,
json: true
})
}
protected static findEmitter(query: any, options?:QueryOptions): Promise<any> {
return rp({
method: 'GET',
uri: 'https://api.example.com/myendpoint',
qs:query,
json: true
})
}
public updateEmitter(options?:QueryOptions): Promise<any> {
return rp({
method: 'PUT',
uri: `https://api.example.com/myendpoint/${this.id}`,
body:this,
json: true
})
}
protected static removeEmitter(query?,options?:QueryOptions):Promise<any> {
return rp({
method: 'DELETE',
uri: `https://api.example.com/myendpoint/${query.id}`,
body: this,
json: true
})
}