Skip to content

Commit

Permalink
Fixed formats and error
Browse files Browse the repository at this point in the history
  • Loading branch information
ManiruzzamanAkash authored Dec 20, 2024
1 parent dace896 commit 246916f
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions src/components/jobs/JobForm.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* External dependencies.
*/
import { useEffect } from '@wordpress/element';
import { useParams } from 'react-router-dom';
import { useSelect, useDispatch } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { useParams } from 'react-router-dom';
import { useEffect } from 'react';

/**
* Internal dependencies.
Expand All @@ -24,8 +24,7 @@ type Props = {
export default function JobForm({ job }: Props) {
const dispatch = useDispatch();
const { id } = useParams();
const {invalidateResolutionForStoreSelector } = useDispatch(jobStore);

const { invalidateResolutionForStoreSelector } = useDispatch(jobStore);

const jobTypes: Array<Select2SingleRow> = useSelect(
(select) => select(jobStore).getJobTypes(),
Expand All @@ -42,17 +41,11 @@ export default function JobForm({ job }: Props) {
[]
);

const { id } = useParams();
const {invalidateResolutionForStoreSelector } = useDispatch(jobStore);

useEffect(() => {

if (parseInt(id) !== form.id) {

invalidateResolutionForStoreSelector('getJobDetail');
}

}, [id,invalidateResolutionForStoreSelector]);
useEffect(() => {
if (parseInt(id + '') !== form.id) {
invalidateResolutionForStoreSelector('getJobDetail');
}
}, [id, invalidateResolutionForStoreSelector]);

const loadingJobs: boolean = useSelect(
(select) => select(jobStore).getLoadingJobs(),
Expand Down

0 comments on commit 246916f

Please sign in to comment.