Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- componentDidMount() {
- document.title = 'Companies';
- this.loadData();
- }
- async loadData() {
- await this.getLocations();
- await this.getIndustries();
- await this.getCompanySizes();
- // await this.getFundings();
- this.getCompanies();
- }
- async getCompanySizes() {
- const data = await getBackJsonByPath('api/companySizes');
- this.setState({
- dataCompanySizes: data
- .filter(x => x.name !== '1-50')
- .map(x => ({ name: x.name, id: x.id, selected: false }))
- });
- }
- // async getFundings() {
- // const data = await getBackJsonByPath('Fundings/all');
- // this.setState({ dataFundings: data.map(x => ({ name: x.name, id: x.id, selected: false })) });
- // }
- async getLocations() {
- const data = await getBackJsonByPath('locations/usedForCompanies');
- const allItems = data.map(x => ({ name: x.metroLocation, id: x.id }));
- const names = _.uniq(allItems.map(x => x.name));
- const items = names.map((x, i) => ({ name: x, id: i, selected: false }));
- items.push(moreComingItem);
- this.setState({ dataLocations: items, allLocations: allItems });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement