<commit_before>import axios from 'axios';
import qs from 'qs';
import Storage from 'common/Storage';
import { API } from 'common/Config';
import StartedRequest from 'common/actions/StartedRequest';

export function ResolvedUpdatePublicationDetails(response) {
  return {
    type: 'RESOLVED_GET_PUBLICATION_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdateBookDetails(response) {
  return {
    type: 'RESOLVED_GET_BOOK_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdateWriterDetails(response) {
  return {
    type: 'RESOLVED_UPDATE_WRITER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdatePublisherDetails(response) {
  return {
    type: 'RESOLVED_UPDATE_PUBLISHER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdateUserDetails(response) {
  return {
    type: 'RESOLVED_UPDATE_USER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdateTagDetails(response) {
  return {
    type: 'RESOLVED_UPDATE_TAG_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdateListDetails(response) {
  return {
    type: 'RESOLVED_UPDATE_LIST_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdatePublicationDetailsList(response) {
  return {
    type: 'RESOLVED_UPDATE_PUBLICATION_DETAILS_LIST',
    data: response.data.response
  };
}

export function updatePublicationDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updatePublicationDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdatePublicationDetails(response)));
	};
}
export function updateBookDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updateBookDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdateBookDetails(response)));
	};
}
export function updateWriterDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updateWriterDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdateWriterDetails(response)));
	};
}
export function updatePublisherDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updatePublisherDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdatePublisherDetails(response)));
	};
}
export function updateUserDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updateUserDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdateUserDetails(response)));
	};
}
export function updateTagDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updateTagDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdateTagDetails(response)));
	};
}
export function updateListDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updateListDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdateListDetails(response)));
	};
}
export function updatePublicationDetailsList(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updatePublicationDetailsList, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdatePublicationDetailsList(response)));
	};
}

export function ResolvedAddBookDetails(response) {
  return {
    type: 'RESOLVED_ADD_BOOK_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddPublicationDetails(response) {
  return {
    type: 'RESOLVED_ADD_PUBLICATION_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddWriterDetails(response) {
  return {
    type: 'RESOLVED_ADD_WRITER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddPublisherDetails(response) {
  return {
    type: 'RESOLVED_ADD_PUBLISHER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddUserDetails(response) {
  return {
    type: 'RESOLVED_ADD_USER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddTagDetails(response) {
  return {
    type: 'RESOLVED_ADD_TAG_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddListDetails(response) {
  return {
    type: 'RESOLVED_ADD_LIST_DETAILS',
    data: response.data.response
  };
}

export function addBookDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addBookDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addPublicationDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addPublicationDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addWriterDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addWriterDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addPublisherDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addPublisherDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addUserDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addUserDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addTagDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addTagDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addListDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addListDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}
<commit_msg>Refresh state on update response.<commit_after>import axios from 'axios';
import qs from 'qs';
import Storage from 'common/Storage';
import { API } from 'common/Config';
import StartedRequest from 'common/actions/StartedRequest';

export function ResolvedUpdatePublicationDetails(response) {
  return {
    type: 'RESOLVED_GET_PUBLICATION_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdateBookDetails(response) {
  return {
    type: 'RESOLVED_GET_BOOK_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdateWriterDetails(response) {
  return {
    type: 'RESOLVED_GET_WRITER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdatePublisherDetails(response) {
  return {
    type: 'RESOLVED_GET_PUBLISHER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdateUserDetails(response) {
  return {
    type: 'RESOLVED_GET_USER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdateTagDetails(response) {
  return {
    type: 'RESOLVED_GET_TAG_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdateListDetails(response) {
  return {
    type: 'RESOLVED_GET_LIST_DETAILS',
    data: response.data.response
  };
}
export function ResolvedUpdatePublicationDetailsList(response) {
  return {
    type: 'RESOLVED_UPDATE_PUBLICATION_DETAILS_LIST',
    data: response.data.response
  };
}

export function updatePublicationDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updatePublicationDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdatePublicationDetails(response)));
	};
}
export function updateBookDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updateBookDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdateBookDetails(response)));
	};
}
export function updateWriterDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updateWriterDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdateWriterDetails(response)));
	};
}
export function updatePublisherDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updatePublisherDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdatePublisherDetails(response)));
	};
}
export function updateUserDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updateUserDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdateUserDetails(response)));
	};
}
export function updateTagDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updateTagDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdateTagDetails(response)));
	};
}
export function updateListDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updateListDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdateListDetails(response)));
	};
}
export function updatePublicationDetailsList(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.updatePublicationDetailsList, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then((response) => dispatch(ResolvedUpdatePublicationDetailsList(response)));
	};
}

export function ResolvedAddBookDetails(response) {
  return {
    type: 'RESOLVED_ADD_BOOK_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddPublicationDetails(response) {
  return {
    type: 'RESOLVED_ADD_PUBLICATION_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddWriterDetails(response) {
  return {
    type: 'RESOLVED_ADD_WRITER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddPublisherDetails(response) {
  return {
    type: 'RESOLVED_ADD_PUBLISHER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddUserDetails(response) {
  return {
    type: 'RESOLVED_ADD_USER_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddTagDetails(response) {
  return {
    type: 'RESOLVED_ADD_TAG_DETAILS',
    data: response.data.response
  };
}
export function ResolvedAddListDetails(response) {
  return {
    type: 'RESOLVED_ADD_LIST_DETAILS',
    data: response.data.response
  };
}

export function addBookDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addBookDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addPublicationDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addPublicationDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
		.then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addWriterDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addWriterDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addPublisherDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addPublisherDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addUserDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addUserDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addTagDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addTagDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}
export function addListDetails(form) {
	return (dispatch) => {
    dispatch(StartedRequest());
    axios.post(API.addListDetails, qs.stringify({
      ...form,
      login_key: Storage.get('login_key')
    }))
    .then(() => {
      window.location.href = window.location.href;
    });
	};
}

{'fraction_non_alphanumeric': 0.14174421120969488, 'fraction_numerical': 0.0, 'mean_word_length': 3.9478943611705923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 63, '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': '1999426', 'n_tokens_mistral': 4479, 'n_tokens_neox': 4382, 'n_words': 688}