Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async getCategory() {
this.appInsights.trackTrace({ message: `'getCategory' - Initiated request`, properties: { User: this.userObjectId }, severityLevel: SeverityLevel.Information });
let category = await getAllCategories();
if (category.status === 200 && category.data) {
this.appInsights.trackTrace({ message: `'getCategory' - Request success`, properties: { User: this.userObjectId }, severityLevel: SeverityLevel.Information });
console.log(category);
this.setState({
categories: category.data,
filteredCategory: category.data
});
}
else {
this.appInsights.trackTrace({ message: `'getCategory' - Request failed`, properties: { User: this.userObjectId }, severityLevel: SeverityLevel.Information });
}
this.setState({
loader: false
});
async getCategory() {
this.appInsights.trackTrace({ message: `'getCategory' - Initiated request`, properties: { User: this.userObjectId }, severityLevel: SeverityLevel.Information });
let category = await getAllCategories();
if (category.status === 200 && category.data) {
this.appInsights.trackTrace({ message: `'getCategory' - Request success`, properties: { User: this.userObjectId }, severityLevel: SeverityLevel.Information });
console.log(category);
this.setState({
categories: category.data,
filteredCategory: category.data
});
}
else {
this.appInsights.trackTrace({ message: `'getCategory' - Request failed`, properties: { User: this.userObjectId }, severityLevel: SeverityLevel.Information });
}
this.setState({
loader: false
});
}