muba-posting 4.1.8 → 4.1.11

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.
@@ -37,8 +37,8 @@ export default class PopupSpendProduct extends React.Component {
37
37
  const PRODUCT_KEY = Product.PREMIUM;
38
38
  const responseJson = await this.props.request(this, PROMOTE_AD, {
39
39
  businessId: this.props.businessId,
40
- adId: this.props.adId,
41
- productKey: PRODUCT_KEY
40
+ productKey: PRODUCT_KEY,
41
+ id: { adId: this.props.adId }
42
42
  });
43
43
 
44
44
  this.props.hideLoading();
@@ -60,8 +60,8 @@ export default class PopupSpendProduct extends React.Component {
60
60
  const PRODUCT_KEY = Product.SUPER_PREMIUM;
61
61
  const responseJson = await this.props.request(this, PROMOTE_AD, {
62
62
  businessId: this.props.businessId,
63
- adId: this.props.adId,
64
- productKey: PRODUCT_KEY
63
+ productKey: PRODUCT_KEY,
64
+ id: { adId: this.props.adId }
65
65
  });
66
66
 
67
67
  this.props.hideLoading();
package/Posting.js CHANGED
@@ -61,6 +61,7 @@ export default class Posting extends React.Component {
61
61
  adId: this.props.adId,
62
62
  maxPictures: 0,
63
63
  countryPhone: '',
64
+ businessId: this.props.businessId,
64
65
  picturesUploaded: 0,
65
66
  postingAd: {
66
67
  category: null,
@@ -120,8 +121,7 @@ export default class Posting extends React.Component {
120
121
  id: null,
121
122
  languageId: currentLocale().toUpperCase(),
122
123
  languages: [{ language: currentLocale().toUpperCase(), title: null, description: null, automatic: true }],
123
- userId: this.props.userId,
124
- userEmail: this.props.userEmail
124
+ userId: this.props.userId
125
125
  }
126
126
  };
127
127
  }
@@ -189,10 +189,15 @@ export default class Posting extends React.Component {
189
189
  }
190
190
 
191
191
  this.getMaxPictures();
192
- this.readBusinessId();
192
+ if (this.state.businessId == null) {
193
+ this.readBusinessId();
194
+ }
193
195
  const hasListings = await this.checkListings();
194
196
  if (this.state.adId != null) {
195
197
  this.setState({ view: this.state.originView });
198
+ if (this.props.changeView) {
199
+ this.props.changeView(this.state.originView)
200
+ }
196
201
  await this.loadAd();
197
202
  } else {
198
203
  await this.setState({ isLoading: false });
@@ -200,6 +205,9 @@ export default class Posting extends React.Component {
200
205
  this.popupNoListings.show();
201
206
  } else {
202
207
  this.setState({ view: this.state.originView });
208
+ if (this.props.changeView) {
209
+ this.props.changeView(this.state.originView)
210
+ }
203
211
  }
204
212
  }
205
213
  BackHandler.addEventListener('hardwareBackPress', this.goBack);
@@ -319,6 +327,9 @@ export default class Posting extends React.Component {
319
327
  }
320
328
  this.scroll.scrollTop();
321
329
  this.setState({ view: view });
330
+ if (this.props.changeView) {
331
+ this.props.changeView(view)
332
+ }
322
333
  }
323
334
 
324
335
  goBack = async () => {
@@ -534,6 +545,7 @@ export default class Posting extends React.Component {
534
545
  <Publish6 ref={(view) => this.publish6Screen = view}
535
546
  postingAd={this.state.postingAd}
536
547
  country={this.props.country}
548
+ businessId={this.state.businessId}
537
549
  scroll={(ref) => this.scroll.scrollIntoView(ref)}
538
550
  saveEditAd={() => this._saveEditAd()}
539
551
  goToPage={(view, params) => this._goToPage(view, null, params)}
package/Publish4.js CHANGED
@@ -74,10 +74,10 @@ export default class Publish4 extends React.Component {
74
74
 
75
75
  async deleteImage(itemDeleted) {
76
76
  if (itemDeleted.id) {
77
- if (!this.props.postingAd.deletedPictures) {
78
- this.props.postingAd.deletedPictures = [];
77
+ if (!this.props.postingAd.deletedFiles) {
78
+ this.props.postingAd.deletedFiles = [];
79
79
  }
80
- this.props.postingAd.deletedPictures.push(itemDeleted.id);
80
+ this.props.postingAd.deletedFiles.push(itemDeleted.id);
81
81
  }
82
82
 
83
83
  let filteredArray = this.props.postingAd.images.filter(item => item !== itemDeleted);
package/Publish6.js CHANGED
@@ -122,10 +122,13 @@ export default class Publish6 extends React.Component {
122
122
 
123
123
  const body = {
124
124
  adId: this.props.postingAd.id,
125
- userId: this.props.postingAd.userId,
126
125
  phones: phones
127
126
  };
128
-
127
+ if (this.props.postingAd.userId) {
128
+ body['userId'] = this.props.postingAd.userId;
129
+ } else if (this.props.businessId) {
130
+ body['businessId'] = this.props.businessId;
131
+ }
129
132
 
130
133
  this.setState({ loading: true });
131
134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muba-posting",
3
- "version": "4.1.8",
3
+ "version": "4.1.11",
4
4
  "description": "Posting",
5
5
  "main": "Posting.js",
6
6
  "scripts": {
package/utils/Views.js CHANGED
@@ -1,11 +1,11 @@
1
1
  export const Views = {
2
- PUBLISH_1: 'Publish1',
3
- PUBLISH_2: 'Publish2',
4
- PUBLISH_2_B: 'Publish2b',
5
- PUBLISH_3: 'Publish3',
6
- PUBLISH_4: 'Publish4',
7
- PUBLISH_5: 'Publish5',
8
- PUBLISH_6: 'Publish6',
9
- PREVIEW: 'Preview',
10
- EDIT_SELECTOR: 'PostingEdit'
2
+ PUBLISH_1: 'publish-1',
3
+ PUBLISH_2: 'publish-2',
4
+ PUBLISH_2_B: 'publish-2b',
5
+ PUBLISH_3: 'publish-3',
6
+ PUBLISH_4: 'publish-4',
7
+ PUBLISH_5: 'publish-5',
8
+ PUBLISH_6: 'publish-6',
9
+ PREVIEW: 'preview',
10
+ EDIT_SELECTOR: 'posting-edit'
11
11
  }