Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onActionMove () {
return api.post('configs', {
data: {
key: `resources.${this.resource.name}.actions.order`,
value: this.resource.actions.map((action) => action.name)
}
}).then((result) => {
}).catch((error) => {
console.error(error)
})
}
}
removeRequest () {
return api.post('resources', {
data: {
name: this.resource.name,
preferences: {
actions: [
{
name: this.action.name,
_remove: true
}
]
}
}
}).then((result) => {
}).catch((error) => {
console.error(error)
})
},
return new Promise((res,rej)=>{
item.collectionId = -1;
/*if (!tryAgain){
try{item.collectionId = UserStore.getUser().config.last_collection}catch(e){}
if (item.collectionId == -99)
item.collectionId = -1;
}*/
Api.post("raindrop", item, (json)=>{
if (!json.result){
if (!tryAgain)
return res(this.insertBookmark(item, true));
if (json.auth===false)
return rej("login_needLogin")
return rej("cant_insert_bookmark")
}
res(json.item||{})
})
})
},
}).then((response: AxiosResponse) => {
const users = response.data;
if (users.length > 0) {
return Promise.reject(1);
}
return API.post('/users', user)
.then((postResponse: AxiosResponse) => {
return postResponse.data;
});
});
}
apiRequest () {
const params = {
data: this.dataBoard,
include: 'tags'
}
if (this.board.id) {
return api.put(`dashboards/${this.dataBoard.id}`, params)
} else {
return api.post('dashboards', params)
}
}
},
if ( ! saving ) {
dispatch( {
type: RATES_RETRIEVAL_COMPLETED,
} );
if ( 'rest_cookie_invalid_nonce' === error ) {
dispatch( exitPrintingFlow( true ) );
} else if ( error ) {
setTimeout( () => reject( error ), 0 );
} else {
setTimeout( resolve, 0 );
}
}
};
setIsSaving( true );
api.post( api.url.getLabelRates( orderId ), { origin, destination, packages } )
.then( setSuccess )
.catch( setError )
.then( () => setIsSaving( false ) );
} );
};