muba-posting 4.1.0 → 4.1.3
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 +2 -2
- package/Publish1.js +4 -4
- package/Publish2.js +1 -1
- package/package.json +1 -1
package/Posting.js
CHANGED
|
@@ -28,7 +28,7 @@ const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
|
|
|
28
28
|
|
|
29
29
|
const CREATE_AD = { method: 'POST', url: '/controller/ads' };
|
|
30
30
|
const UPDATE_AD = { method: 'PUT', url: '/controller/ads/{adId}' };
|
|
31
|
-
const AD = { method: 'GET', url: '/controller/ads/{adId}' };
|
|
31
|
+
const AD = { method: 'GET', url: '/controller/ads/{adId}/posting' };
|
|
32
32
|
const BUSINESS_ID = { method: 'GET', url: '/controller/users/{userId}/businessId' };
|
|
33
33
|
const BUSINESS_PRODUCTS = { method: 'GET', url: '/controller/products/{key}/remaining' };
|
|
34
34
|
const MAX_PICTURES = { method: 'GET', url: '/controller/max-pictures' };
|
|
@@ -183,7 +183,7 @@ export default class Posting extends React.Component {
|
|
|
183
183
|
|
|
184
184
|
loadData = async (canPublish) => {
|
|
185
185
|
if (canPublish) {
|
|
186
|
-
const resultJson = await this.props.request(this, COUNTRY_PHONE
|
|
186
|
+
const resultJson = await this.props.request(this, COUNTRY_PHONE);
|
|
187
187
|
if (resultJson.status === 200) {
|
|
188
188
|
this.setState({ countryPhone: resultJson.list[0].formattedPhone });
|
|
189
189
|
}
|
package/Publish1.js
CHANGED
|
@@ -37,7 +37,7 @@ export default class Publish1 extends React.Component {
|
|
|
37
37
|
if (responseJson.status === 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
|
-
this.props.postingAd.subCategory = this.props.postingAd.subCategory != null ? this.props.postingAd.subCategory : this.jsonCategories[0].
|
|
40
|
+
this.props.postingAd.subCategory = this.props.postingAd.subCategory != null ? this.props.postingAd.subCategory : this.jsonCategories[0].subList[0].value;
|
|
41
41
|
|
|
42
42
|
await this.setState({
|
|
43
43
|
transactionOptions: { elements: this.jsonCategories.map(jsonCategory => { return { label: jsonCategory.label, value: jsonCategory.value } }), selectedItem: this.props.postingAd.category },
|
|
@@ -68,7 +68,7 @@ export default class Publish1 extends React.Component {
|
|
|
68
68
|
getSubCategories(category) {
|
|
69
69
|
return this.jsonCategories?.find((categoryJson) =>
|
|
70
70
|
categoryJson.value === category
|
|
71
|
-
).
|
|
71
|
+
).subList;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
async changeCategory(category) {
|
|
@@ -108,13 +108,13 @@ export default class Publish1 extends React.Component {
|
|
|
108
108
|
if (this.validateForm()) {
|
|
109
109
|
for (var i = 0; i < this.state.typeBienOptions.elements.length; i++) {
|
|
110
110
|
if (this.state.typeBienOptions.elements[i].value == this.state.typeBienOptions.selectedItem) {
|
|
111
|
-
this.props.postingAd.subCategoryDetails = this.state.typeBienOptions.elements[i].
|
|
111
|
+
this.props.postingAd.subCategoryDetails = this.state.typeBienOptions.elements[i].subList;
|
|
112
112
|
break;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
if (this.props.postingAd.id == null || this.props.fullPosting) {
|
|
117
|
-
if (this.props.postingAd.
|
|
117
|
+
if (this.props.postingAd.exactlyLocated) {
|
|
118
118
|
this.props.goToPage(Views.PUBLISH_2);
|
|
119
119
|
} else {
|
|
120
120
|
this.props.goToPage(Views.PUBLISH_2_B);
|
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.status === 200) {
|
|
66
66
|
if (responseJson.exactlyLocated) {
|
|
67
67
|
this.props.postingAd.exactlyLocated = true;
|
|
68
68
|
validateLocation = true;
|