mirror of
https://github.com/wassname/talk.git
synced 2026-08-15 12:55:10 +08:00
Working on the tests & sending CSRF
This commit is contained in:
@@ -221,8 +221,13 @@ export function postItem (item, type, id) {
|
||||
*/
|
||||
|
||||
export function postAction (item_id, item_type, action) {
|
||||
return () => {
|
||||
return coralApi(`/${item_type}/${item_id}/actions`, {method: 'POST', body: action});
|
||||
return (dispatch, getState) => {
|
||||
action._csrf = getState().auth.get('_csrf');
|
||||
return coralApi(`/${item_type}/${item_id}/actions`, {method: 'POST', body: action})
|
||||
.then((json) => {
|
||||
dispatch(updateItem(action.item_id, action.action_type, action.id, item_type));
|
||||
return json;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
const Notification = (props) => {
|
||||
console.log('ACA EL PROBLEMA notification');
|
||||
if (props.notification.text) {
|
||||
setTimeout(() => {
|
||||
props.clearNotification();
|
||||
|
||||
Reference in New Issue
Block a user