From 8b5dcb84c235979814183a22008e80dce8a24df7 Mon Sep 17 00:00:00 2001 From: ucpr Date: Sat, 13 Jun 2020 00:43:33 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20submissions=E3=81=AEselector?= =?UTF-8?q?=E3=81=AE=E5=90=8D=E5=89=8D=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SubmissionCodeBlock/SubmissionCodeBlockContainer.js | 2 +- .../SubmissionDetails/SubmissionDetailsContainer.js | 2 +- .../SubmissionsPageTable/SubmissionsPageTableContainer.js | 2 +- src/state/ducks/submissions/selectors.js | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/organisms/SubmissionCodeBlock/SubmissionCodeBlockContainer.js b/src/organisms/SubmissionCodeBlock/SubmissionCodeBlockContainer.js index 15c5bf8..6a50ebe 100644 --- a/src/organisms/SubmissionCodeBlock/SubmissionCodeBlockContainer.js +++ b/src/organisms/SubmissionCodeBlock/SubmissionCodeBlockContainer.js @@ -5,7 +5,7 @@ import SubmissionCodeBlockComponent from "./SubmissionCodeBlockComponent"; import { submissionsSelectors } from "../../state/ducks/submissions"; const mapStateToProps = (state, props) => ({ - submission: submissionsSelectors.getSubmissionsBySubmitId(state, props), + submission: submissionsSelectors.getSubmissionBySubmitId(state, props), }); export default connect(mapStateToProps)(SubmissionCodeBlockComponent); diff --git a/src/organisms/SubmissionDetails/SubmissionDetailsContainer.js b/src/organisms/SubmissionDetails/SubmissionDetailsContainer.js index 83ce6a7..be5d637 100644 --- a/src/organisms/SubmissionDetails/SubmissionDetailsContainer.js +++ b/src/organisms/SubmissionDetails/SubmissionDetailsContainer.js @@ -5,7 +5,7 @@ import SubmissionDetailsComponent from "./SubmissionDetailsComponent"; import { submissionsOperations, submissionsSelectors } from "../../state/ducks/submissions"; const mapStateToProps = (state, props) => ({ - submission: submissionsSelectors.getSubmissionsBySubmitId(state, props), + submission: submissionsSelectors.getSubmissionBySubmitId(state, props), }); const mapDispatchToProps = { diff --git a/src/organisms/SubmissionsPageTable/SubmissionsPageTableContainer.js b/src/organisms/SubmissionsPageTable/SubmissionsPageTableContainer.js index 8d746b8..032c17c 100644 --- a/src/organisms/SubmissionsPageTable/SubmissionsPageTableContainer.js +++ b/src/organisms/SubmissionsPageTable/SubmissionsPageTableContainer.js @@ -5,7 +5,7 @@ import { submissionsOperations, submissionsSelectors } from "../../state/ducks/s const mapStateToProps = state => ({ page: submissionsSelectors.getPage(state), total: submissionsSelectors.getTotal(state), - submissions: submissionsSelectors.getSubmissions(state), + submissions: submissionsSelectors.getSubmissionList(state), }); const mapDispatchToProps = { diff --git a/src/state/ducks/submissions/selectors.js b/src/state/ducks/submissions/selectors.js index c648880..faaf6f6 100644 --- a/src/state/ducks/submissions/selectors.js +++ b/src/state/ducks/submissions/selectors.js @@ -9,11 +9,11 @@ const submissionsUISelector = state => state.submissionsState.submissions.ui || const isfetched = createSelector(submissionsSelector, submissions => submissions.upcoming !== void 0); // 特定のContestのSubmission一覧を取得する -const getSubmissions = createSelector(submissionsSelector, submissions => Object.values(submissions)); +const getSubmissionList = createSelector(submissionsSelector, submissions => Object.values(submissions)); // Submission単体を取得する. // propsにSubmitIdが必要 -const getSubmissionsBySubmitId = createSelector(submissionSelector, submission => { +const getSubmissionBySubmitId = createSelector(submissionSelector, submission => { const result = { username: submission["username"], submitDate: submission["submit_date"], @@ -40,8 +40,8 @@ const getTotal = createSelector(submissionsUISelector, ui => ui.total); export default { isfetched, - getSubmissions, - getSubmissionsBySubmitId, + getSubmissionList, + getSubmissionBySubmitId, getPage, getTotal, };