tradly 1.0.83 → 1.0.85
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/Constants/PathConstant.js +7 -1
- package/Roots/App.js +88 -1
- package/package.json +1 -1
|
@@ -26,6 +26,7 @@ export const USERS = "/v1/users";
|
|
|
26
26
|
export const DEVICES = "/v1/devices";
|
|
27
27
|
|
|
28
28
|
export const ADDRESS = "/v1/addresses";
|
|
29
|
+
export const SEARCHADDRESS = "/v1/addresses/search?key=";
|
|
29
30
|
export const PLACES_ADDRESS = "/v1/addresses/places_search";
|
|
30
31
|
export const PLACES_ADDRESS_DETAIL = "/v1/addresses/place_detail";
|
|
31
32
|
export const CURRENCY = "/v1/currencies";
|
|
@@ -58,7 +59,6 @@ export const TENANTSHIPPINGMETHOD = "/v1/tenants/shipping_methods";
|
|
|
58
59
|
export const SHIPPINGMETHOD = "/v1/shipping_methods";
|
|
59
60
|
|
|
60
61
|
export const S3SIGNEDURL = "/v1/utils/S3signedUploadURL";
|
|
61
|
-
export const SEARCHADDRESS = "/v1/addresses/search?key=";
|
|
62
62
|
|
|
63
63
|
export const HOME = "/products/v1/home";
|
|
64
64
|
export const ORDERS = "/products/v1/orders";
|
|
@@ -92,3 +92,9 @@ export const CLIENTTRANSLATION_GROUPS = "/v1/client_translations/groups";
|
|
|
92
92
|
export const CLIENTTRANSLATION_VALUES = "/v1/client_translations/values";
|
|
93
93
|
export const CLIENTTRANSLATION_VALUES_GROUP =
|
|
94
94
|
"/v1/client_translations/values_grouped";
|
|
95
|
+
|
|
96
|
+
export const CREATE_FEEDBACK = "/v1/utils/feedback";
|
|
97
|
+
export const FEEDBACK_CATEGORIES = "/v1/utils/feedback_categories";
|
|
98
|
+
|
|
99
|
+
export const GET_COMMENTS = "/v1/comments";
|
|
100
|
+
export const CREATE_COMMENTS = "/v1/comments";
|
package/Roots/App.js
CHANGED
|
@@ -54,6 +54,10 @@ import {
|
|
|
54
54
|
CLIENTTRANSLATION_VALUES_GROUP,
|
|
55
55
|
PLACES_ADDRESS,
|
|
56
56
|
PLACES_ADDRESS_DETAIL,
|
|
57
|
+
FEEDBACK_CATEGORIES,
|
|
58
|
+
CREATE_FEEDBACK,
|
|
59
|
+
GET_COMMENTS,
|
|
60
|
+
CREATE_COMMENTS,
|
|
57
61
|
} from "./../Constants/PathConstant.js";
|
|
58
62
|
import serialization from "../Helper/Serialization.js";
|
|
59
63
|
import { ImageConfig } from "../Helper/APIParam.js";
|
|
@@ -1904,7 +1908,7 @@ class App {
|
|
|
1904
1908
|
let method =
|
|
1905
1909
|
param.id == undefined || param.id == ""
|
|
1906
1910
|
? Method.POST
|
|
1907
|
-
: Method.
|
|
1911
|
+
: Method.PATCH;
|
|
1908
1912
|
let path =
|
|
1909
1913
|
param.id == undefined || param.id == ""
|
|
1910
1914
|
? LAYER
|
|
@@ -2005,6 +2009,89 @@ class App {
|
|
|
2005
2009
|
return error;
|
|
2006
2010
|
}
|
|
2007
2011
|
}
|
|
2012
|
+
|
|
2013
|
+
//MARK:- Feedback
|
|
2014
|
+
async getFeedbackCategories(param = { authKey, bodyParam }) {
|
|
2015
|
+
try {
|
|
2016
|
+
const [error, responseJson] = await network.networkCall({
|
|
2017
|
+
path: FEEDBACK_CATEGORIES,
|
|
2018
|
+
method: Method.GET,
|
|
2019
|
+
authKey: param.authKey,
|
|
2020
|
+
});
|
|
2021
|
+
if (error) {
|
|
2022
|
+
return error;
|
|
2023
|
+
} else {
|
|
2024
|
+
return responseJson;
|
|
2025
|
+
}
|
|
2026
|
+
} catch (error) {
|
|
2027
|
+
return error;
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
async createFeedback(param = { authKey, data }) {
|
|
2031
|
+
try {
|
|
2032
|
+
const [error, responseJson] = await network.networkCall({
|
|
2033
|
+
path: CREATE_FEEDBACK,
|
|
2034
|
+
method: Method.POST,
|
|
2035
|
+
authKey: param.authKey,
|
|
2036
|
+
param: param.data,
|
|
2037
|
+
});
|
|
2038
|
+
if (error) {
|
|
2039
|
+
return error;
|
|
2040
|
+
} else {
|
|
2041
|
+
return responseJson;
|
|
2042
|
+
}
|
|
2043
|
+
} catch (error) {
|
|
2044
|
+
return error;
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
// COMMENTS
|
|
2049
|
+
async getComments(param = { authKey, bodyParam }) {
|
|
2050
|
+
let url =
|
|
2051
|
+
param.bodyParam == undefined || param.bodyParam == ""
|
|
2052
|
+
? ""
|
|
2053
|
+
: `?${serialization(param.bodyParam)}`;
|
|
2054
|
+
try {
|
|
2055
|
+
const [error, responseJson] = await network.networkCall({
|
|
2056
|
+
path: GET_COMMENTS + url,
|
|
2057
|
+
method: Method.GET,
|
|
2058
|
+
authKey: param.authKey,
|
|
2059
|
+
});
|
|
2060
|
+
if (error) {
|
|
2061
|
+
return error;
|
|
2062
|
+
} else {
|
|
2063
|
+
return responseJson;
|
|
2064
|
+
}
|
|
2065
|
+
} catch (error) {
|
|
2066
|
+
return error;
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
async addEditComments(param = { id, authKey, data }) {
|
|
2071
|
+
let method =
|
|
2072
|
+
param.id == undefined || param.id == ""
|
|
2073
|
+
? Method.POST
|
|
2074
|
+
: Method.PATCH;
|
|
2075
|
+
let path =
|
|
2076
|
+
param.id == undefined || param.id == ""
|
|
2077
|
+
? CREATE_COMMENTS
|
|
2078
|
+
: CREATE_COMMENTS + `/${param.id}`;
|
|
2079
|
+
try {
|
|
2080
|
+
const [error, responseJson] = await network.networkCall({
|
|
2081
|
+
path: path,
|
|
2082
|
+
method: method,
|
|
2083
|
+
authKey: param.authKey,
|
|
2084
|
+
param: param.data,
|
|
2085
|
+
});
|
|
2086
|
+
if (error) {
|
|
2087
|
+
return error;
|
|
2088
|
+
} else {
|
|
2089
|
+
return responseJson;
|
|
2090
|
+
}
|
|
2091
|
+
} catch (error) {
|
|
2092
|
+
return error;
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2008
2095
|
}
|
|
2009
2096
|
const app = new App();
|
|
2010
2097
|
export default app;
|