Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function deleteResource (url) {
return axios.delete(url)
}
handleDeleteClick(e: any, row: Api.CallStatusClientResponseModel) {
axios
.delete(Constants.ApiEndpoint + ApiRoutes.CallStatus + '/' + row.id, {
headers: GlobalUtilities.defaultHeaders(),
})
.then(resp => {
this.setState({
...this.state,
deleteResponse: 'Record deleted',
deleteSuccess: true,
deleteSubmitted: true,
});
this.loadRecords(this.state.searchValue);
})
.catch((error: AxiosError) => {
GlobalUtilities.logError(error);
this.setState({
...this.state,
handleDeleteClick(e: any, row: Api.LinkLogClientResponseModel) {
axios
.delete(Constants.ApiEndpoint + ApiRoutes.LinkLogs + '/' + row.id, {
headers: GlobalUtilities.defaultHeaders(),
})
.then(resp => {
this.setState({
...this.state,
deleteResponse: 'Record deleted',
deleteSuccess: true,
deleteSubmitted: true,
});
this.loadRecords(this.state.searchValue);
})
.catch((error: AxiosError) => {
GlobalUtilities.logError(error);
this.setState({
...this.state,
handleDeleteClick(e: any, row: Api.ProductClientResponseModel) {
axios
.delete(
Constants.ApiEndpoint + ApiRoutes.Products + '/' + row.productID,
{
headers: {
'Content-Type': 'application/json',
},
}
)
.then(
resp => {
this.setState({
...this.state,
deleteResponse: 'Record deleted',
deleteSuccess: true,
deleteSubmitted: true,
});
async deleteRow(params) {
let result = await window.swal({
title: this.$t('labels.are_you_sure'),
type: 'warning',
showCancelButton: true,
cancelButtonText: this.$t('buttons.cancel'),
confirmButtonColor: '#dd4b39',
confirmButtonText: this.$t('buttons.delete')
})
if (result.value) {
try {
let { data } = await axios.delete(
this.$app.route(this.deleteRoute, params)
)
this.onContextChanged()
this.$app.noty[data.status](data.message)
} catch (e) {
this.$app.error(e)
}
}
},
async onBulkAction() {
function deleteService(name) {
logger.info('Deleting service: %s', name);
return axios.delete(`${SERVICE_URL}/${name}`)
.then(response => response.data)
.catch(handleDeleteError('service', name));
}
handleDeleteClick(e: any, row: Api.PersonTypeClientResponseModel) {
axios
.delete(Constants.ApiEndpoint + ApiRoutes.PersonTypes + '/' + row.id, {
headers: GlobalUtilities.defaultHeaders(),
})
.then(resp => {
this.setState({
...this.state,
deleteResponse: 'Record deleted',
deleteSuccess: true,
deleteSubmitted: true,
});
this.loadRecords(this.state.searchValue);
})
.catch((error: AxiosError) => {
GlobalUtilities.logError(error);
this.setState({
...this.state,
export function deleteMessagesByApp(id: number) {
if (id === -1) {
axios.delete(config.get('url') + 'message').then(() => {
dispatcher.dispatch({type: 'DELETE_MESSAGES', payload: -1});
snack('Messages deleted');
});
} else {
axios.delete(config.get('url') + 'application/' + id + '/message').then(() => {
dispatcher.dispatch({type: 'DELETE_MESSAGES', payload: id});
snack('Deleted all messages from the application');
});
}
}
deleteProject(data, next) {
axios.delete(apiUrl + '/api/projects/' + data._id)
.then(res => {
next({data: res.data});
})
.catch(err => {
next({error: err});
throw err;
});
}
};