muba-posting 4.1.4 → 4.1.7
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/PopupSpendProduct.js +3 -3
- package/Posting.js +4 -4
- package/Publish1.js +1 -1
- package/Publish2.js +1 -1
- package/Publish2b.js +4 -4
- package/Publish3.js +1 -1
- package/Publish6.js +5 -3
- package/package.json +1 -1
package/PopupSpendProduct.js
CHANGED
|
@@ -22,7 +22,7 @@ export default class PopupSpendProduct extends React.Component {
|
|
|
22
22
|
|
|
23
23
|
async componentDidMount() {
|
|
24
24
|
const resultJson = await this.props.request(this, COUNTRY_PHONE);
|
|
25
|
-
if (resultJson.
|
|
25
|
+
if (resultJson.httpStatus === 200) {
|
|
26
26
|
this.setState({ countryPhone: resultJson.list[0].formattedPhone });
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -42,7 +42,7 @@ export default class PopupSpendProduct extends React.Component {
|
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
this.props.hideLoading();
|
|
45
|
-
if (responseJson.
|
|
45
|
+
if (responseJson.httpStatus === 200 && responseJson.remaining >= -1) {
|
|
46
46
|
if (responseJson.remaining > -1) {
|
|
47
47
|
result = 1;
|
|
48
48
|
}
|
|
@@ -65,7 +65,7 @@ export default class PopupSpendProduct extends React.Component {
|
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
this.props.hideLoading();
|
|
68
|
-
if (responseJson.
|
|
68
|
+
if (responseJson.httpStatus === 200 && responseJson.remaining >= -1) {
|
|
69
69
|
if (responseJson.remaining > -1) {
|
|
70
70
|
result = 1;
|
|
71
71
|
}
|
package/Posting.js
CHANGED
|
@@ -184,7 +184,7 @@ export default class Posting extends React.Component {
|
|
|
184
184
|
loadData = async (canPublish) => {
|
|
185
185
|
if (canPublish) {
|
|
186
186
|
const resultJson = await this.props.request(this, COUNTRY_PHONE);
|
|
187
|
-
if (resultJson.
|
|
187
|
+
if (resultJson.httpStatus === 200) {
|
|
188
188
|
this.setState({ countryPhone: resultJson.list[0].formattedPhone });
|
|
189
189
|
}
|
|
190
190
|
|
|
@@ -234,7 +234,7 @@ export default class Posting extends React.Component {
|
|
|
234
234
|
|
|
235
235
|
async readBusinessId() {
|
|
236
236
|
const responseJson = await this.props.request(this, BUSINESS_ID, { userId: this.props.userId });
|
|
237
|
-
if (responseJson.
|
|
237
|
+
if (responseJson.httpStatus === 200) {
|
|
238
238
|
this.setState({
|
|
239
239
|
businessId: responseJson.value
|
|
240
240
|
});
|
|
@@ -243,7 +243,7 @@ export default class Posting extends React.Component {
|
|
|
243
243
|
|
|
244
244
|
async getMaxPictures() {
|
|
245
245
|
const responseJson = await this.props.request(this, MAX_PICTURES);
|
|
246
|
-
if (responseJson.
|
|
246
|
+
if (responseJson.httpStatus === 200) {
|
|
247
247
|
this.setState({
|
|
248
248
|
maxPictures: responseJson.value
|
|
249
249
|
})
|
|
@@ -265,7 +265,7 @@ export default class Posting extends React.Component {
|
|
|
265
265
|
|
|
266
266
|
if (!this.state.postingAd.id && this.state.postingAd.town) {
|
|
267
267
|
const response = await this.props.request(this, CREATE_AD, this.state.postingAd);
|
|
268
|
-
if (response.
|
|
268
|
+
if (response.httpStatus === 200) {
|
|
269
269
|
await this.setState({
|
|
270
270
|
postingAd: { ...this.state.postingAd, id: response.id }
|
|
271
271
|
})
|
package/Publish1.js
CHANGED
|
@@ -34,7 +34,7 @@ export default class Publish1 extends React.Component {
|
|
|
34
34
|
userId: this.props.postingAd.userId
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
if (responseJson.
|
|
37
|
+
if (responseJson.httpStatus === 200) {
|
|
38
38
|
this.jsonCategories = responseJson.list;
|
|
39
39
|
this.props.postingAd.category = this.props.postingAd.category != null ? this.props.postingAd.category : this.jsonCategories[0].value;
|
|
40
40
|
this.props.postingAd.subCategory = this.props.postingAd.subCategory != null ? this.props.postingAd.subCategory : this.jsonCategories[0].subList[0].value;
|
package/Publish2.js
CHANGED
|
@@ -62,7 +62,7 @@ export default class Publish2 extends React.Component {
|
|
|
62
62
|
longitude: this.props.postingAd.longitude
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
if (responseJson.
|
|
65
|
+
if (responseJson.httpStatus === 200) {
|
|
66
66
|
if (responseJson.exactlyLocated) {
|
|
67
67
|
this.props.postingAd.exactlyLocated = true;
|
|
68
68
|
validateLocation = true;
|
package/Publish2b.js
CHANGED
|
@@ -94,7 +94,7 @@ export default class Publish2b extends React.Component {
|
|
|
94
94
|
if (this.state.regionOptions.elements.length <= 1) {
|
|
95
95
|
const responseJson = await this.props.request(this.props.context, GET_REGIONS, {});
|
|
96
96
|
|
|
97
|
-
if (responseJson.
|
|
97
|
+
if (responseJson.httpStatus === 200) {
|
|
98
98
|
const regionOptions = {
|
|
99
99
|
elements: [this.state.regionOptions.elements[0]],
|
|
100
100
|
selectedItem: this.props.postingAd.region
|
|
@@ -120,7 +120,7 @@ export default class Publish2b extends React.Component {
|
|
|
120
120
|
regionId: this.props.postingAd.region
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
if (responseJson.
|
|
123
|
+
if (responseJson.httpStatus === 200) {
|
|
124
124
|
var cityOptions = {
|
|
125
125
|
elements: [this.state.cityOptions.elements[0]],
|
|
126
126
|
selectedItem: null
|
|
@@ -157,7 +157,7 @@ export default class Publish2b extends React.Component {
|
|
|
157
157
|
cityId: this.props.postingAd.city
|
|
158
158
|
});
|
|
159
159
|
|
|
160
|
-
if (responseJson.
|
|
160
|
+
if (responseJson.httpStatus === 200) {
|
|
161
161
|
let districtOptions = {
|
|
162
162
|
elements: [this.state.districtOptions.elements[0]],
|
|
163
163
|
selectedItem: null
|
|
@@ -199,7 +199,7 @@ export default class Publish2b extends React.Component {
|
|
|
199
199
|
districtId: this.props.postingAd.district
|
|
200
200
|
});
|
|
201
201
|
|
|
202
|
-
if (responseJson.
|
|
202
|
+
if (responseJson.httpStatus === 200) {
|
|
203
203
|
var townOptions = {
|
|
204
204
|
elements: [this.state.townOptions.elements[0]],
|
|
205
205
|
selectedItem: null
|
package/Publish3.js
CHANGED
|
@@ -64,7 +64,7 @@ export default class Publish3 extends React.Component {
|
|
|
64
64
|
const responseJson = await this.props.request(this.props.context, GET_CURRENCIES, {});
|
|
65
65
|
const priceOptions = this.state.priceOptions;
|
|
66
66
|
|
|
67
|
-
if (responseJson.
|
|
67
|
+
if (responseJson.httpStatus === 200) {
|
|
68
68
|
responseJson.list.map((item) => {
|
|
69
69
|
priceOptions.elements.push(item);
|
|
70
70
|
});
|
package/Publish6.js
CHANGED
|
@@ -9,7 +9,7 @@ import { createIconSetFromFontello } from 'react-native-vector-icons';
|
|
|
9
9
|
import fontelloConfig from './fonts/config.json';
|
|
10
10
|
const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
|
|
11
11
|
|
|
12
|
-
const GENERATE_TITLE_DESCRIPTION = { method: '
|
|
12
|
+
const GENERATE_TITLE_DESCRIPTION = { method: 'GET', url: '/controller/generate-title-description' };
|
|
13
13
|
const PHONE_REGISTERED = { method: 'GET', url: '/controller/phone-registered' };
|
|
14
14
|
const window = Dimensions.get('window');
|
|
15
15
|
const PHONE_SEPARATOR = '###';
|
|
@@ -76,9 +76,11 @@ export default class Publish6 extends React.Component {
|
|
|
76
76
|
this.props.showLoading();
|
|
77
77
|
const ad = { ...this.props.postingAd };
|
|
78
78
|
delete ad.images;
|
|
79
|
+
delete ad.subCategoryDetails;
|
|
80
|
+
delete ad.languages;
|
|
79
81
|
const responseJson = await this.props.request(this.props.context, GENERATE_TITLE_DESCRIPTION, ad);
|
|
80
82
|
|
|
81
|
-
if (responseJson?.
|
|
83
|
+
if (responseJson?.httpStatus === 200) {
|
|
82
84
|
if (this.props.postingAd.languages[0].title === undefined || this.props.postingAd.languages[0].title === null) {
|
|
83
85
|
this.props.postingAd.languages[0].title = responseJson.title;
|
|
84
86
|
}
|
|
@@ -129,7 +131,7 @@ export default class Publish6 extends React.Component {
|
|
|
129
131
|
|
|
130
132
|
const responseJson = await this.props.request(this.props.context, PHONE_REGISTERED, body);
|
|
131
133
|
validate = responseJson.value === 'true' && validate;
|
|
132
|
-
this.setState({ existingPhoneError:
|
|
134
|
+
this.setState({ existingPhoneError: responseJson.value !== 'true' });
|
|
133
135
|
|
|
134
136
|
this.languageItem.forEach(element => validate = element.validateLanguageItem() && validate);
|
|
135
137
|
}
|