mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 03:37:56 +01:00
Enable redux dev tools and refactor http requests
This commit is contained in:
@@ -2,6 +2,8 @@ import { Action } from 'redux';
|
||||
import { ThunkAction } from 'redux-thunk';
|
||||
import { State } from '../reducers/rootReducer';
|
||||
|
||||
import buildRequestHeaders from '../helpers/buildRequestHeaders';
|
||||
|
||||
export const CHANGE_POST_BOARD_SUCCESS = 'CHANGE_POST_BOARD_SUCCESS';
|
||||
export interface ChangePostBoardSuccessAction {
|
||||
type: typeof CHANGE_POST_BOARD_SUCCESS;
|
||||
@@ -21,11 +23,7 @@ export const changePostBoard = (
|
||||
try {
|
||||
const response = await fetch(`/posts/${postId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-Token': authenticityToken,
|
||||
},
|
||||
headers: buildRequestHeaders(authenticityToken),
|
||||
body: JSON.stringify({
|
||||
post: {
|
||||
board_id: newBoardId,
|
||||
|
||||
Reference in New Issue
Block a user