muba-posting 4.1.3 → 4.1.4

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/Posting.js CHANGED
@@ -228,24 +228,26 @@ export default class Posting extends React.Component {
228
228
  }
229
229
 
230
230
  async checkListings() {
231
- const response = await this.props.request(this, BUSINESS_PRODUCTS, { key: 'LISTING' });
232
- return response > 0;
231
+ const responseJson = await this.props.request(this, BUSINESS_PRODUCTS, { key: 'LISTING' });
232
+ return responseJson.value > 0;
233
233
  }
234
234
 
235
235
  async readBusinessId() {
236
- const response = await this.props.request(this, BUSINESS_ID, { userId: this.props.userId });
237
- if (response.status !== 404) {
236
+ const responseJson = await this.props.request(this, BUSINESS_ID, { userId: this.props.userId });
237
+ if (responseJson.status === 200) {
238
238
  this.setState({
239
- businessId: response
239
+ businessId: responseJson.value
240
240
  });
241
241
  }
242
242
  }
243
243
 
244
244
  async getMaxPictures() {
245
- const response = await this.props.request(this, MAX_PICTURES, {});
246
- this.setState({
247
- maxPictures: response
248
- })
245
+ const responseJson = await this.props.request(this, MAX_PICTURES);
246
+ if (responseJson.status === 200) {
247
+ this.setState({
248
+ maxPictures: responseJson.value
249
+ })
250
+ }
249
251
  }
250
252
 
251
253
  async loadAd() {
package/Publish6.js CHANGED
@@ -127,8 +127,8 @@ export default class Publish6 extends React.Component {
127
127
 
128
128
  this.setState({ loading: true });
129
129
 
130
- const phoneFree = await this.props.request(this.props.context, PHONE_REGISTERED, body);
131
- validate = phoneFree && validate;
130
+ const responseJson = await this.props.request(this.props.context, PHONE_REGISTERED, body);
131
+ validate = responseJson.value === 'true' && validate;
132
132
  this.setState({ existingPhoneError: !phoneFree });
133
133
 
134
134
  this.languageItem.forEach(element => validate = element.validateLanguageItem() && validate);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muba-posting",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "description": "Posting",
5
5
  "main": "Posting.js",
6
6
  "scripts": {