Skip to content

Commit

Permalink
Merge pull request #105 from dhis2/fix-view-route
Browse files Browse the repository at this point in the history
fix(view-route): use hooks instead of selectors
  • Loading branch information
ismay authored Feb 23, 2021
2 parents d07c108 + 89c8862 commit a66bf5d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pages/JobView/JobView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from 'react'
import React from 'react'
import { useParams } from 'react-router-dom'
import {
Card,
Expand All @@ -9,7 +9,7 @@ import {
InputField,
} from '@dhis2/ui'
import i18n from '@dhis2/d2-i18n'
import { StoreContext, selectors } from '../../components/Store'
import { hooks } from '../../components/Store'
import { DiscardFormButton } from '../../components/Buttons'
import { JobDetails } from '../../components/JobDetails'
import translateCron from '../../services/translate-cron'
Expand All @@ -20,7 +20,6 @@ const infoLink =
'https://docs.dhis2.org/master/en/user/html/dataAdmin_scheduling.html#dataAdmin_scheduling_config'

const JobView = () => {
const store = useContext(StoreContext)
const { id } = useParams()
const {
name,
Expand All @@ -29,7 +28,7 @@ const JobView = () => {
lastExecuted,
jobType,
cronExpression,
} = selectors.getJobById(store, id)
} = hooks.useJob(id)

return (
<React.Fragment>
Expand Down

0 comments on commit a66bf5d

Please sign in to comment.