Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadQuery () {
this.isLoadingQuery = true
return api.get(`run_queries/${this.alert.query_id}`, {
}).then((result) => {
this.data = result.data.data
this.columns = result.data.meta.columns
}).catch((error) => {
console.error(error)
}).finally(() => {
this.isLoadingQuery = false
})
}
}
loadTags () {
this.isLoading = true
api.get('tags').then((result) => {
this.tags = result.data.data
}).catch((error) => {
console.error(error)
}).finally(() => {
this.isLoading = false
})
}
}
onLoadId(id, callback) {
if ((_state.item||{})._id == id)
return;
_state.item = {};
_state.status = "loading";
this.trigger(_state);
Api.get("raindrop/"+id, (json)=>{
if (json.result){
_state.item = json.item;
_state.status = "done";
if (typeof callback == "function")
callback(item);
}
else{
_state.status = "error";
if (typeof callback == "function")
callback(false);
}
this.loadSuggestedTags().then(()=>this.trigger(_state))
})
handleFetchData() {
fetchAPI.get('/book/list/')
.then((resp) => {
const { status, data } = resp;
if (status === 200) {
this.setState({
bookList: data.data
});
}
});
}
function dashboardsRequest () {
dashboardsRequestLock ||= api.get('dashboards', {
params: {
include: 'tags',
fields: {
dashboard: 'id,title,tags,updated_at',
tags: 'id,name'
}
}
}).finally(() => {
dashboardsRequestLock = null
})
return dashboardsRequestLock
}
public static login(email: string, password: string): Promise {
return API.get('/users', {
params: {
email,
password,
},
}).then((response: AxiosResponse) => {
const users = response.data;
if (users.length === 0) {
return Promise.reject(1);
}
return users[0];
});
}
}