<commit_before>import { takeLatest, put, call } from 'redux-saga/effects';

import {
  REQUEST_USER_IMPORTS_SUCCESS,
  REQUEST_USER_IMPORTS,
  REQUEST_USER_IMPORTS_FAILURE,
} from 'actions/userImportsActions';
import getUserImportsCall from 'api/getUserImportsApi';

export function* getUserImportsFlow(action) {
  try {
    const userID = action.meta;
    const responseListOfImports = yield call(getUserImportsCall, userID);
    if (!responseListOfImports) {
      throw new Error('Received undefined list.');
    }
    const listOfImports = responseListOfImports.map(responseImport => ({
      id: responseImport.id,
      timeStamp: 5, // TODO: change when the API actually returns one
      status: responseImport.attributes.status,
      type: 'pptx',
      name: 'jhonny', //TODO: same
    }));
<commit_msg>Fixed returned objects based on what the API returns<commit_after>import { takeLatest, put, call } from 'redux-saga/effects';

import {
  REQUEST_USER_IMPORTS_SUCCESS,
  REQUEST_USER_IMPORTS,
  REQUEST_USER_IMPORTS_FAILURE,
} from 'actions/userImportsActions';
import getUserImportsCall from 'api/getUserImportsApi';

export function* getUserImportsFlow(action) {
  try {
    const userID = action.meta;
    const responseListOfImports = yield call(getUserImportsCall, userID);
    if (!responseListOfImports) {
      throw new Error('Received undefined list.');
    }
    const listOfImports = responseListOfImports.map(responseImport => ({
      id: responseImport.id,
      timestamp: responseImport.attributes.createdAt,
      status: responseImport.attributes.status,
      type: 'pptx', // TODO
      name: responseImport.attributes.name,
    }));

{'fraction_non_alphanumeric': 0.09832134292565947, 'fraction_numerical': 0.0005995203836930455, 'mean_word_length': 4.281645569620253, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6813155', 'n_tokens_mistral': 515, 'n_tokens_neox': 509, 'n_words': 115}