Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mounted () {
axios.get('/api/portfolios').then(res => {
this.items = res.data.map(e => ({id: e.id, name: e.name}))
}, error => {
console.error(error)
})
}
}
loadRecords() {
this.setState({ ...this.state, loading: true });
axios
.get(this.props.apiRoute, {
headers: {
'Content-Type': 'application/json',
},
})
.then(
resp => {
let response = resp.data as Array;
console.log(response);
let mapper = new LinkTypeMapper();
let linkTypes: Array = [];
response.forEach(x => {
loadRecords(query: string = '') {
this.setState({ ...this.state, searchValue: query });
let searchEndpoint =
Constants.ApiEndpoint + ApiRoutes.SpaceSpaceFeatures + '?limit=100';
if (query) {
searchEndpoint += '&query=' + query;
}
axios
.get>(searchEndpoint, {
headers: GlobalUtilities.defaultHeaders(),
})
.then(response => {
let viewModels: Array = [];
let mapper = new SpaceSpaceFeatureMapper();
response.data.forEach(x => {
viewModels.push(mapper.mapApiResponseToViewModel(x));
});
this.setState({
records: viewModels,
filteredRecords: viewModels,
loading: false,
loaded: true,
asyncCheckEmail = (email) => {
return Axios.get('http://localhost:5000/email_exists/' + email)
}
getUser() {
const config = this.getRequestConfig();
return axios.get('/api/auth/me/', config).then(response => {
Object.assign(this.user, response.data);
return this.user;
});
},
register(user) {
export function getKPIData(id) {
return axios.get(
`${config.API_URL}/dashboard/kpis/${id}/data?silentError=true`
);
}
get: url => axios.get(url, config),
post: (url, data) => axios.post(url, data, config),
const componentWillMount = function componentWillMount() {
get('/weather').then(response => {
this.setState({ weather: camelizeKeys(response.data).report });
});
};
api.settings.hasMongoDBTools = () => {
return axios.get('/api/v1/backup/hastools').then(res => {
return res.data
})
}
api.settings.fetchBackups = () => {
loadRecords(query: string = '') {
this.setState({ ...this.state, searchValue: query });
let searchEndpoint =
Constants.ApiEndpoint + ApiRoutes.VehicleCapabilities + '?limit=100';
if (query) {
searchEndpoint += '&query=' + query;
}
axios
.get>(searchEndpoint, {
headers: GlobalUtilities.defaultHeaders(),
})
.then(response => {
let viewModels: Array = [];
let mapper = new VehicleCapabilitiesMapper();
response.data.forEach(x => {
viewModels.push(mapper.mapApiResponseToViewModel(x));
});
this.setState({
records: viewModels,
filteredRecords: viewModels,
loading: false,
loaded: true,