tradly 1.1.17 → 1.1.19
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.
- package/Roots/App.js +54 -0
- package/package.json +1 -1
package/Roots/App.js
CHANGED
|
@@ -950,6 +950,7 @@ class App {
|
|
|
950
950
|
|
|
951
951
|
//MARK:- Negotiate
|
|
952
952
|
|
|
953
|
+
// POST
|
|
953
954
|
async addNegotiation(param = { id, authKey, data }) {
|
|
954
955
|
let method = Method.POST;
|
|
955
956
|
let path = LISTINGS + `/${param.id}` + NEGOTIATE;
|
|
@@ -971,6 +972,59 @@ class App {
|
|
|
971
972
|
return error;
|
|
972
973
|
}
|
|
973
974
|
}
|
|
975
|
+
|
|
976
|
+
// PATCH
|
|
977
|
+
async updateNegotiation(param = { id, authKey, data, negotiation_id }) {
|
|
978
|
+
let method = Method.PATCH;
|
|
979
|
+
let path =
|
|
980
|
+
LISTINGS +
|
|
981
|
+
`/${param.id}` +
|
|
982
|
+
NEGOTIATE +
|
|
983
|
+
`/${param.negotiation_id}`;
|
|
984
|
+
try {
|
|
985
|
+
const [error, responseJson] = await network.networkCall({
|
|
986
|
+
path: path,
|
|
987
|
+
method: method,
|
|
988
|
+
authKey: param.authKey,
|
|
989
|
+
currency: param.currency,
|
|
990
|
+
language: param.language,
|
|
991
|
+
param: param.data,
|
|
992
|
+
});
|
|
993
|
+
if (error) {
|
|
994
|
+
return error;
|
|
995
|
+
} else {
|
|
996
|
+
return responseJson;
|
|
997
|
+
}
|
|
998
|
+
} catch (error) {
|
|
999
|
+
return error;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
// GET
|
|
1004
|
+
async getNegotiationList(param = { id, authKey, bodyParam }) {
|
|
1005
|
+
let method = Method.GET;
|
|
1006
|
+
let path =
|
|
1007
|
+
LISTINGS +
|
|
1008
|
+
`/${param.id}` +
|
|
1009
|
+
NEGOTIATE +
|
|
1010
|
+
`?${serialization(param.bodyParam)}`;
|
|
1011
|
+
try {
|
|
1012
|
+
const [error, responseJson] = await network.networkCall({
|
|
1013
|
+
path: path,
|
|
1014
|
+
method: method,
|
|
1015
|
+
authKey: param.authKey,
|
|
1016
|
+
currency: param.currency,
|
|
1017
|
+
language: param.language,
|
|
1018
|
+
});
|
|
1019
|
+
if (error) {
|
|
1020
|
+
return error;
|
|
1021
|
+
} else {
|
|
1022
|
+
return responseJson;
|
|
1023
|
+
}
|
|
1024
|
+
} catch (error) {
|
|
1025
|
+
return error;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
974
1028
|
//MARK:- Schedules
|
|
975
1029
|
async createSchedule(param = { id, authKey, data }) {
|
|
976
1030
|
let path = LISTINGS + `/${param.id}` + SCHEDULE;
|