tradly 1.0.39 → 1.0.42
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 +1 -0
- package/Roots/App.js +10 -3
- package/package.json +1 -1
|
@@ -43,6 +43,7 @@ export const LISTINGS = 'products/v1/listings';
|
|
|
43
43
|
export const LIKE = '/likes';
|
|
44
44
|
export const SCHEDULE = '/schedules';
|
|
45
45
|
export const SCHEDULEPERDAY = '/schedules_per_day?';
|
|
46
|
+
export const SLUG = '/by_slug/';
|
|
46
47
|
|
|
47
48
|
export const VARIANTTYPES = 'products/v1/variant_types';
|
|
48
49
|
export const VARIANTS = '/variants';
|
package/Roots/App.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
VALUES, TRANSACTIONS, EARNINGS, VARIANTTYPES,
|
|
10
10
|
EPHERMERALKEY, PAYMENTINTENT, CONFIGLIST, STATUS,
|
|
11
11
|
S3SIGNEDURL, STRIPECONNECTACCOUNT,
|
|
12
|
-
CREATEACCOUNTLINK, CREATEEXPRESSLOGINLINK, SCHEDULE, SCHEDULEPERDAY, COUNTRIES, TENANTSCOUNTRIES,
|
|
12
|
+
CREATEACCOUNTLINK, CREATEEXPRESSLOGINLINK, SCHEDULE, SCHEDULEPERDAY, COUNTRIES, TENANTSCOUNTRIES, SLUG,
|
|
13
13
|
} from './../Constants/PathConstant.js'
|
|
14
14
|
import serialization from "../Helper/Serialization.js";
|
|
15
15
|
import { APPCONSTANT } from "../Constants/AppConstant.js";
|
|
@@ -167,6 +167,12 @@ class App {
|
|
|
167
167
|
else { return responseJson }
|
|
168
168
|
} catch (error) { return error }
|
|
169
169
|
}
|
|
170
|
+
async getListingSlug(param={id,authKey}) {
|
|
171
|
+
try { const [error, responseJson] = await network.networkCall({path:LISTINGS + SLUG +`/${param.id}`,method:Method.GET,authKey:param.authKey});
|
|
172
|
+
if (error) { return error }
|
|
173
|
+
else { return responseJson }
|
|
174
|
+
} catch (error) { return error }
|
|
175
|
+
}
|
|
170
176
|
async deleteListing(param={id,authKey}) {
|
|
171
177
|
try { const [error, responseJson] = await network.networkCall({path:LISTINGS + `/${param.id}`,method:Method.DELETE,authKey:param.authKey});
|
|
172
178
|
if (error) { return error }
|
|
@@ -196,8 +202,9 @@ class App {
|
|
|
196
202
|
else { return responseJson }
|
|
197
203
|
} catch (error) { return error }
|
|
198
204
|
}
|
|
199
|
-
async commonFuntion(param={path,bodyParam,authKey,Method}) {
|
|
200
|
-
|
|
205
|
+
async commonFuntion(param={path,bodyParam,data,authKey,Method}) {
|
|
206
|
+
let url = param.bodyParam == undefined || param.bodyParam == '' ? '' : `?${serialization(param.bodyParam)}`;
|
|
207
|
+
try { const [error, responseJson] = await network.networkCall({path:url,method:param.Method,authKey:param.authKey,param:param.data});
|
|
201
208
|
if (error) { return error }
|
|
202
209
|
else { return responseJson }
|
|
203
210
|
} catch (error) { return error }
|