tradly 1.0.84 → 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 +4 -1
- package/Roots/App.js +51 -1
- package/package.json +1 -1
|
@@ -94,4 +94,7 @@ export const CLIENTTRANSLATION_VALUES_GROUP =
|
|
|
94
94
|
"/v1/client_translations/values_grouped";
|
|
95
95
|
|
|
96
96
|
export const CREATE_FEEDBACK = "/v1/utils/feedback";
|
|
97
|
-
export const FEEDBACK_CATEGORIES = "/v1/utils/
|
|
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
|
@@ -56,6 +56,8 @@ import {
|
|
|
56
56
|
PLACES_ADDRESS_DETAIL,
|
|
57
57
|
FEEDBACK_CATEGORIES,
|
|
58
58
|
CREATE_FEEDBACK,
|
|
59
|
+
GET_COMMENTS,
|
|
60
|
+
CREATE_COMMENTS,
|
|
59
61
|
} from "./../Constants/PathConstant.js";
|
|
60
62
|
import serialization from "../Helper/Serialization.js";
|
|
61
63
|
import { ImageConfig } from "../Helper/APIParam.js";
|
|
@@ -1906,7 +1908,7 @@ class App {
|
|
|
1906
1908
|
let method =
|
|
1907
1909
|
param.id == undefined || param.id == ""
|
|
1908
1910
|
? Method.POST
|
|
1909
|
-
: Method.
|
|
1911
|
+
: Method.PATCH;
|
|
1910
1912
|
let path =
|
|
1911
1913
|
param.id == undefined || param.id == ""
|
|
1912
1914
|
? LAYER
|
|
@@ -2042,6 +2044,54 @@ class App {
|
|
|
2042
2044
|
return error;
|
|
2043
2045
|
}
|
|
2044
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
|
+
}
|
|
2045
2095
|
}
|
|
2046
2096
|
const app = new App();
|
|
2047
2097
|
export default app;
|