muba-posting 4.1.8 → 4.1.9

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
@@ -121,7 +121,7 @@ export default class Posting extends React.Component {
121
121
  languageId: currentLocale().toUpperCase(),
122
122
  languages: [{ language: currentLocale().toUpperCase(), title: null, description: null, automatic: true }],
123
123
  userId: this.props.userId,
124
- userEmail: this.props.userEmail
124
+ businessId: this.props.businessId
125
125
  }
126
126
  };
127
127
  }
@@ -189,7 +189,9 @@ export default class Posting extends React.Component {
189
189
  }
190
190
 
191
191
  this.getMaxPictures();
192
- this.readBusinessId();
192
+ if (this.state.postingAd.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 });
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.postingAd.businessId) {
130
+ body['businessId'] = this.props.postingAd.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.9",
4
4
  "description": "Posting",
5
5
  "main": "Posting.js",
6
6
  "scripts": {