muba-posting 4.1.21 → 4.1.22
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 +16 -6
- package/Publish6.js +2 -1
- package/package.json +1 -1
package/Posting.js
CHANGED
|
@@ -209,10 +209,14 @@ export default class Posting extends React.Component {
|
|
|
209
209
|
this.popupNoListings.show();
|
|
210
210
|
} else {
|
|
211
211
|
const pendingAd = await this.props.request(this, LOAD_PENDING_CREATED);
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
if (pendingAd.httpStatus === 200) {
|
|
213
|
+
const languages = pendingAd?.languages.length > 0 ? pendingAd?.languages : this.state.postingAd.languages
|
|
214
|
+
const languageId = languages[0].language;
|
|
215
|
+
await this.setState({
|
|
216
|
+
postingAd: { ...this.state.postingAd, ...pendingAd, languageId: languageId, languages: languages },
|
|
217
|
+
isLoading: false
|
|
218
|
+
});
|
|
219
|
+
}
|
|
216
220
|
|
|
217
221
|
this.setState({ view: this.state.originView });
|
|
218
222
|
if (this.props.changeView) {
|
|
@@ -281,8 +285,12 @@ export default class Posting extends React.Component {
|
|
|
281
285
|
|
|
282
286
|
prevViews.unshift(this.state.view);
|
|
283
287
|
|
|
284
|
-
if (this.state.postingAd.town) {
|
|
285
|
-
const
|
|
288
|
+
if (this.state.fullPosting && this.state.postingAd.town && Views.PUBLISH_6 !== this.state.view) {
|
|
289
|
+
const ad = { ...this.state.postingAd };
|
|
290
|
+
if (Views.PUBLISH_4 !== this.state.view) {
|
|
291
|
+
delete ad.images;
|
|
292
|
+
}
|
|
293
|
+
const response = await this.props.request(this, CREATE_AD, ad);
|
|
286
294
|
if (response.httpStatus === 200) {
|
|
287
295
|
await this.setState({
|
|
288
296
|
postingAd: { ...this.state.postingAd, id: response.id }
|
|
@@ -370,6 +378,7 @@ export default class Posting extends React.Component {
|
|
|
370
378
|
}
|
|
371
379
|
|
|
372
380
|
async _saveEditAd() {
|
|
381
|
+
this._showLoading();
|
|
373
382
|
const ad = { ...this.state.postingAd, id: { adId: this.state.postingAd.id } };
|
|
374
383
|
if (this.state.originView === Views.EDIT_SELECTOR && Views.PUBLISH_4 !== this.state.view) {
|
|
375
384
|
delete ad.images;
|
|
@@ -388,6 +397,7 @@ export default class Posting extends React.Component {
|
|
|
388
397
|
await this.setState({ postingAd: { ...this.state.postingAd, adId: response.id } });
|
|
389
398
|
this._goToPage(Views.PREVIEW, null, response);
|
|
390
399
|
}
|
|
400
|
+
this._hideLoading();
|
|
391
401
|
|
|
392
402
|
if (this.props.showRatingPopup) {
|
|
393
403
|
this.props.showRatingPopup();
|
package/Publish6.js
CHANGED
|
@@ -62,7 +62,8 @@ export default class Publish6 extends React.Component {
|
|
|
62
62
|
return false;
|
|
63
63
|
}
|
|
64
64
|
for (let index = 0; index < firstList?.length; ++index) {
|
|
65
|
-
if (firstList[index].
|
|
65
|
+
if (firstList[index].title != secondList[index].title
|
|
66
|
+
|| firstList[index].description != secondList[index].description) {
|
|
66
67
|
return false;
|
|
67
68
|
}
|
|
68
69
|
}
|