-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalternate — копия.js
40 lines (33 loc) · 1.07 KB
/
alternate — копия.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var SEARCHMODULE;
/**
*@NApiVersion 2.x
*@NScriptType Restlet
*@NModuleScope Public
*/
define(['N/search'], runRestlet);
//********************** MAIN FUNCTION **********************
function runRestlet(search){
SEARCHMODULE = search;
var returnObj = {};
returnObj.get = doGet;
returnObj.post = doPost;
returnObj.put = doPut;
returnObj.delete = doDelete;
return returnObj;
}
function doGet(restletBody){
log.debug('Called from GET', restletBody);
return "Hello from GET.<br /> Data received:<br />" + JSON.stringify(restletBody);
}
function doPost(restletBody){
log.debug('Called from POST', restletBody);
return "Hello from POST.\nData received:\n" + JSON.stringify(restletBody);
}
function doPut(restletBody){
log.debug('Called from PUT', restletBody);
return "Hello from PUT.\nData received:\n" + JSON.stringify(restletBody);
}
function doDelete(restletBody){
log.debug('Called from DELETE', restletBody);
return "Hello from DELETE.\nData received:\n" + JSON.stringify(restletBody);
}