Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Commit

Permalink
refactor: submissionsのselectorの名前を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
ucpr committed Jun 12, 2020
1 parent 3d453ad commit 8b5dcb8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
8 changes: 4 additions & 4 deletions src/state/ducks/submissions/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -40,8 +40,8 @@ const getTotal = createSelector(submissionsUISelector, ui => ui.total);

export default {
isfetched,
getSubmissions,
getSubmissionsBySubmitId,
getSubmissionList,
getSubmissionBySubmitId,
getPage,
getTotal,
};

0 comments on commit 8b5dcb8

Please sign in to comment.