<commit_before>import { createAction } from 'redux-actions';

export const FACEBOOK_SIGNIN = 'FACEBOOK_SIGNIN';
export const FACEBOOK_ID = 'FACEBOOK_ID';
export const FACEBOOK_TOKEN = 'FACEBOOK_TOKEN';


export function getFacebookId(user_id) {
	return {
		type: FACEBOOK_ID,
		user_id
	}
}

export function facebookSignIn(attemptedFBLogin) {
	return {
		type: FACEBOOK_SIGNIN,
    attemptedFBLogin
	}
}

export function setFacebookToken(token) {
  return {
    type: FACEBOOK_TOKEN,
    token
  }
}

export function validateFBLogin(userInfo) {
  return dispatch => {
    dispatch(facebookSignIn(userInfo))
    return fetch('http://localhost:3000/api/carly/users/FbLogin', {
      method: 'POST',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        userId: userInfo.userId
      })
    }).then((response) => response.json())
      .then((responseData) => {
        console.log('RES', responseData)    
      });
  }
}



<commit_msg>Update faceBookAction.js<commit_after>import { createAction } from 'redux-actions';

export const FACEBOOK_SIGNIN = 'FACEBOOK_SIGNIN';
export const FACEBOOK_ID = 'FACEBOOK_ID';
export const FACEBOOK_TOKEN = 'FACEBOOK_TOKEN';


export function getFacebookId(user_id) {
	return {
		type: FACEBOOK_ID,
		user_id
	}
}

export function facebookSignIn(attemptedFBLogin) {
	return {
		type: FACEBOOK_SIGNIN,
    attemptedFBLogin
	}
}

export function setFacebookToken(token) {
  return {
    type: FACEBOOK_TOKEN,
    token
  }
}

//should always validate on login or app open
export function validateFBLogin(userInfo) {
  return dispatch => {
    dispatch(facebookSignIn(userInfo))
    return fetch('http://localhost:3000/api/carly/users/FbLogin', {
      method: 'POST',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        userId: userInfo.userId
      })
    }).then((response) => response.json())
      .then((responseData) => {
        console.log('RES', responseData)    
      });
  }
}




{'fraction_non_alphanumeric': 0.12292358803986711, 'fraction_numerical': 0.0037968675842429997, 'mean_word_length': 3.3463917525773197, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4528031', 'n_tokens_mistral': 718, 'n_tokens_neox': 720, 'n_words': 131}