muba-posting 4.1.6 → 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/PopupSpendProduct.js +1 -1
- package/Posting.js +6 -4
- package/Publish4.js +3 -3
- package/Publish6.js +9 -4
- package/package.json +1 -1
package/PopupSpendProduct.js
CHANGED
|
@@ -7,7 +7,7 @@ import Icon from '@expo/vector-icons/FontAwesome';
|
|
|
7
7
|
import { strings } from 'muba-i18n';
|
|
8
8
|
import commonStyles from './commonStyles';
|
|
9
9
|
|
|
10
|
-
export const PROMOTE_AD = { method: 'PUT', url: '/controller/
|
|
10
|
+
export const PROMOTE_AD = { method: 'PUT', url: '/controller/ads/{adId}/promote' };
|
|
11
11
|
const COUNTRY_PHONE = { method: 'GET', url: '/controller/countries/{countryCode}/phones' };
|
|
12
12
|
|
|
13
13
|
export default class PopupSpendProduct extends React.Component {
|
package/Posting.js
CHANGED
|
@@ -29,9 +29,9 @@ const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
|
|
|
29
29
|
const CREATE_AD = { method: 'POST', url: '/controller/ads' };
|
|
30
30
|
const UPDATE_AD = { method: 'PUT', url: '/controller/ads/{adId}' };
|
|
31
31
|
const AD = { method: 'GET', url: '/controller/ads/{adId}/posting' };
|
|
32
|
-
const BUSINESS_ID = { method: 'GET', url: '/controller/users/{userId}/
|
|
32
|
+
const BUSINESS_ID = { method: 'GET', url: '/controller/users/{userId}/business-id' };
|
|
33
33
|
const BUSINESS_PRODUCTS = { method: 'GET', url: '/controller/products/{key}/remaining' };
|
|
34
|
-
const MAX_PICTURES = { method: 'GET', url: '/controller/max-pictures' };
|
|
34
|
+
const MAX_PICTURES = { method: 'GET', url: '/controller/posting/max-pictures' };
|
|
35
35
|
const COUNTRY_PHONE = { method: 'GET', url: '/controller/countries/{countryCode}/phones' };
|
|
36
36
|
|
|
37
37
|
export default class Posting extends React.Component {
|
|
@@ -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
|
-
|
|
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.
|
|
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.
|
|
78
|
-
this.props.postingAd.
|
|
77
|
+
if (!this.props.postingAd.deletedFiles) {
|
|
78
|
+
this.props.postingAd.deletedFiles = [];
|
|
79
79
|
}
|
|
80
|
-
this.props.postingAd.
|
|
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
|
@@ -9,8 +9,8 @@ import { createIconSetFromFontello } from 'react-native-vector-icons';
|
|
|
9
9
|
import fontelloConfig from './fonts/config.json';
|
|
10
10
|
const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
|
|
11
11
|
|
|
12
|
-
const GENERATE_TITLE_DESCRIPTION = { method: '
|
|
13
|
-
const PHONE_REGISTERED = { method: 'GET', url: '/controller/phone-registered' };
|
|
12
|
+
const GENERATE_TITLE_DESCRIPTION = { method: 'GET', url: '/controller/posting/generate-title-description' };
|
|
13
|
+
const PHONE_REGISTERED = { method: 'GET', url: '/controller/posting/phone-registered' };
|
|
14
14
|
const window = Dimensions.get('window');
|
|
15
15
|
const PHONE_SEPARATOR = '###';
|
|
16
16
|
|
|
@@ -76,6 +76,8 @@ export default class Publish6 extends React.Component {
|
|
|
76
76
|
this.props.showLoading();
|
|
77
77
|
const ad = { ...this.props.postingAd };
|
|
78
78
|
delete ad.images;
|
|
79
|
+
delete ad.subCategoryDetails;
|
|
80
|
+
delete ad.languages;
|
|
79
81
|
const responseJson = await this.props.request(this.props.context, GENERATE_TITLE_DESCRIPTION, ad);
|
|
80
82
|
|
|
81
83
|
if (responseJson?.httpStatus === 200) {
|
|
@@ -120,10 +122,13 @@ export default class Publish6 extends React.Component {
|
|
|
120
122
|
|
|
121
123
|
const body = {
|
|
122
124
|
adId: this.props.postingAd.id,
|
|
123
|
-
userId: this.props.postingAd.userId,
|
|
124
125
|
phones: phones
|
|
125
126
|
};
|
|
126
|
-
|
|
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
|
+
}
|
|
127
132
|
|
|
128
133
|
this.setState({ loading: true });
|
|
129
134
|
|