import { store } from 'index' ; import { GetPublicUserInputs } from 'shared/page/GetPublicUser' ; import { SetNameInputs } from 'shared/page/SetName' ; export const GET_USER_REQUEST = 'GET_USER_REQUEST' ; export const GET_USER_COMMIT = 'GET_USER_COMMIT' ; export const GET_USER_ROLLBACK = 'GET_USER_ROLLBACK' ; export const getUser = ( { username } ) => ( dispatch ) => { dispatch ( { type : GET_USER_REQUEST , payload : { username } , meta : { offline : { effect : { url : `${ process . env . REACT_APP_BACKEND_URL }/page/get-user` , method : 'POST' , headers : { Authorization : `Bearer ${ store . getState ( ) . auth . jwt }` } , json : { username } , } , commit : { type : GET_USER_COMMIT , meta : { username } } , rollback : { type : GET_USER_ROLLBACK , meta : { username } } , } , } , } ) ; } ; export const SET_NAME_REQUEST = 'SET_NAME_REQUEST' ; export const SET_NAME_COMMIT = 'SET_NAME_COMMIT' ; export const SET_NAME_ROLLBACK = 'SET_NAME_ROLLBACK' ; export const sendName = ( { name } ) => ( dispatch ) => { dispatch ( { type : SET_NAME_REQUEST , payload : { } , meta : { offline : { effect : { url : `${ process . env . REACT_APP_BACKEND_URL }/page/set-name` , method : 'POST' , headers : { Authorization : `Bearer ${ store . getState ( ) . auth . jwt }` } , json : { name } , } , commit : { type : SET_NAME_COMMIT , meta : { } } , rollback : { type : SET_NAME_ROLLBACK , meta : { } } , } , } , } ) ; } ;