<commit_before>import { createThunkAction } from 'utils/redux';
import { FORM_ERROR } from 'final-form';

import { updateProfile } from 'services/user';
import { setMyGFW } from 'providers/mygfw-provider/actions';

export const saveProfile = createThunkAction(
  'saveProfile',
  ({
    id,
    signUpForNewsletter,
    subsector,
    subsector_otherInput,
    ...rest
  }) => dispatch => {
    const postData = {
      id,
      ...rest,
      subsector:
        subsector && subsector.includes('Other')
          ? `Other: ${subsector_otherInput || ''}`
          : subsector,
      signUpForNewsletter:
        !!signUpForNewsletter &&
        signUpForNewsletter.length &&
        signUpForNewsletter.includes('newsletter')
          ? 'true'
          : false
    };

    return updateProfile(id, postData)
      .then(response => {
        if (response.data && response.data.data) {
          const { attributes } = response.data.data;
          dispatch(
            setMyGFW({
              loggedIn: true,
              id: response.data.data.id,
              ...attributes
            })
          );
        }

        return true;
      })<commit_msg>Added howDoYouUse_otherInput to the save profile post action<commit_after>import { createThunkAction } from 'utils/redux';
import { FORM_ERROR } from 'final-form';

import { updateProfile } from 'services/user';
import { setMyGFW } from 'providers/mygfw-provider/actions';

export const saveProfile = createThunkAction(
  'saveProfile',
  ({
    id,
    signUpForNewsletter,
    subsector,
    subsector_otherInput,
    howDoYouUse,
    howDoYouUse_otherInput,
    ...rest
  }) => dispatch => {
    const postData = {
      id,
      ...rest,
      subsector:
        subsector && subsector.includes('Other')
          ? `Other: ${subsector_otherInput || ''}`
          : subsector,
      howDoYouUse:
        howDoYouUse && howDoYouUse.includes('Other')
          ? `Other: ${howDoYouUse_otherInput || ''}`
          : subsector,
      signUpForNewsletter:
        !!signUpForNewsletter &&
        signUpForNewsletter.length &&
        signUpForNewsletter.includes('newsletter')
          ? 'true'
          : false
    };

    return updateProfile(id, postData)
      .then(response => {
        if (response.data && response.data.data) {
          const { attributes } = response.data.data;
          dispatch(
            setMyGFW({
              loggedIn: true,
              id: response.data.data.id,
              ...attributes
            })
          );
        }

        return true;
      })
{'fraction_non_alphanumeric': 0.11799065420560748, 'fraction_numerical': 0.0, 'mean_word_length': 2.0081967213114753, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4663404', 'n_tokens_mistral': 760, 'n_tokens_neox': 745, 'n_words': 139}