<commit_before>import repo from '../api/repo'
import * as types from '../constants/ActionTypes'

function recieveSessions(sessions) {
    return {
        type: types.RECIEVE_SESSIONS,
        sessions: sessions
    }
}
function recieveSettings(settings) {
    return {
        type: types.RECIEVE_SETTINGS,
        settings: settings
    }
}

function deleteSessionUnsafe(id) {
  return {
    type: types.SESSION_DELETE,
    id
  }
}

function updateSessionUnsafe(id) {
  return {
    type: types.SESSION_UPDATE,
    id
  }
}

export function getAllSessions() {
    return dispatch => {
      repo.getSettings(settings => {
        dispatch(recieveSettings(settings))
      })
    }
}

export function getAllSessions() {
    return dispatch => {
      repo.getSessions(sessions => {
        dispatch(recieveSessions(sessions))
      })
    }
}

export function deleteSession(id) {
  return (dispatch, getState) => {
    repo.remove(id,(e) => dispatch(deleteSessionUnsafe(id)))
  }
}

export function updateSession(data) {
  return (dispatch, getState) => {
    repo.update(data,(e)=>dispatch(updateSessionUnsafe(id)))
  }
}

export function submitTime(id) {
  return (dispatch, getState) => {
    repo.submitTime(id,(e)=>{console.log('removed',e)})
  }
}<commit_msg>fixed the param to take entire data object<commit_after>import repo from '../api/repo'
import * as types from '../constants/ActionTypes'

function recieveSessions(sessions) {
    return {
        type: types.RECIEVE_SESSIONS,
        sessions: sessions
    }
}
function recieveSettings(settings) {
    return {
        type: types.RECIEVE_SETTINGS,
        settings: settings
    }
}

function deleteSessionUnsafe(id) {
  return {
    type: types.SESSION_DELETE,
    id
  }
}

function updateSessionUnsafe(data) {
  return {
    type: types.SESSION_UPDATE,
    id:data.id
  }
}

export function getAllSessions() {
    return dispatch => {
      repo.getSettings(settings => {
        dispatch(recieveSettings(settings))
      })
    }
}

export function getAllSessions() {
    return dispatch => {
      repo.getSessions(sessions => {
        dispatch(recieveSessions(sessions))
      })
    }
}

export function deleteSession(id) {
  return (dispatch, getState) => {
    repo.remove(id,(e) => dispatch(deleteSessionUnsafe(id)))
  }
}

export function updateSession(data) {
  return (dispatch, getState) => {
    repo.update(data,(e)=>dispatch(updateSessionUnsafe(data)))
  }
}

export function submitTime(id) {
  return (dispatch, getState) => {
    repo.submitTime(id,(e)=>{console.log('removed',e)})
  }
}
{'fraction_non_alphanumeric': 0.12893203883495147, 'fraction_numerical': 0.0, 'mean_word_length': 3.271973466003317, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '6670185', 'n_tokens_mistral': 818, 'n_tokens_neox': 822, 'n_words': 149}