some question about onDeleteClick method
whois002 opened this issue · 0 comments
whois002 commented
onDeleteClick() {
this.props.deletePost(this.props.params.id)
.then(() => { this.context.router.push('/'); });
}
export function deletePost(id) {
const request = axios.delete(${ROOT_URL}/posts/${id}${API_KEY}
);
return {
type: DELETE_POST,
payload: request
};
}
The function "deletePost" does not return a promise. so why the "then" method in function "onDeleteClick" can direct call?