Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add operation delete to native script
  • Loading branch information
ManuelFernando committed Nov 29, 2017
commit 9d06815eb2f871e139cf5c6e3f5fcf1e89ea2594
4 changes: 2 additions & 2 deletions src/nativescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import PubNubCore from '../core/pubnub-common';
import Networking from '../networking';
import Database from '../db/common';
import { get, post } from '../networking/modules/nativescript';
import { del, get, post } from '../networking/modules/nativescript';
import { InternalSetupStruct } from '../core/flow_interfaces';

export default class extends PubNubCore {
constructor(setup: InternalSetupStruct) {
setup.db = new Database();
setup.networking = new Networking({ get, post });
setup.networking = new Networking({ del, get, post });
setup.sdkFamily = 'NativeScript';
super(setup);
}
Expand Down
5 changes: 5 additions & 0 deletions src/networking/modules/nativescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ export function post(params: Object, body: string, endpoint: EndpointDefinition,
let url = this.getStandardOrigin() + endpoint.url;
return xdr.call(this, 'POST', url, params, body, endpoint, callback);
}

export function del(params: Object, endpoint: EndpointDefinition, callback: Function) {
let url = this.getStandardOrigin() + endpoint.url;
return xdr.call(this, 'DELETE', url, params, {}, endpoint, callback);
}