<commit_before>import { RECEIVE_INITIAL_CAMPAIGN, UPDATE_COURSE } from "../constants";

const initialState = {
  title: '',
  description: '',
  school: '',
  term: '',
  level: '',
  subject: '',
  expected_students: '0',
  start: null,
  end: null,
  day_exceptions: '',
  weekdays: '0000000',
  editingSyllabus: false
};

export default function course(state = initialState, action) {
  switch (action.type) {
    case UPDATE_COURSE:
      return { ...state, ...data.course };
    case RECEIVE_INITIAL_CAMPAIGN: {
      const campaign = action.data.campaign;
      const newState = {
        ...state,
        initial_campaign_id: campaign.id,
        initial_campaign_title: campaign.title,
        description: campaign.template_description
      };
      return newState;
    }
    default:
      return state;<commit_msg>Fix reducer<commit_after>import { RECEIVE_INITIAL_CAMPAIGN, UPDATE_COURSE } from "../constants";

const initialState = {
  title: '',
  description: '',
  school: '',
  term: '',
  level: '',
  subject: '',
  expected_students: '0',
  start: null,
  end: null,
  day_exceptions: '',
  weekdays: '0000000',
  editingSyllabus: false
};

export default function course(state = initialState, action) {
  switch (action.type) {
    case UPDATE_COURSE:
      return { ...state, ...action.course };
    case RECEIVE_INITIAL_CAMPAIGN: {
      const campaign = action.data.campaign;
      const newState = {
        ...state,
        initial_campaign_id: campaign.id,
        initial_campaign_title: campaign.title,
        description: campaign.template_description
      };
      return newState;
    }
    default:
      return state;
{'fraction_non_alphanumeric': 0.12560386473429952, 'fraction_numerical': 0.00966183574879227, 'mean_word_length': 2.9452380952380954, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '5924340', 'n_tokens_mistral': 541, 'n_tokens_neox': 513, 'n_words': 112}