Skip to content

Commit

Permalink
refactor: replace fiche existence check with fiche action count
Browse files Browse the repository at this point in the history
  • Loading branch information
elisfainstein committed Jan 8, 2025
1 parent 9361f3c commit bc6ce98
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { FicheResume } from 'packages/api/src/plan-actions';
import ActionsGroupeesMenu from '../ActionsGroupees/ActionsGroupeesMenu';
import EmptyFichePicto from '../FicheAction/FichesLiees/EmptyFichePicto';
import { useCreateFicheAction } from '../FicheAction/data/useCreateFicheAction';
import { useFicheActionCount } from '../FicheAction/data/useFicheActionCount';
import { useCreatePlanAction } from '../PlanAction/data/useUpsertAxe';

type sortByOptionsType = SortFichesAction & {
Expand Down Expand Up @@ -140,10 +141,7 @@ const FichesActionListe = ({
const { data, isLoading } = useFicheResumesFetch({
options: ficheResumesOptions,
});

const { data: ficheExistenceData } = useFicheResumesFetch();

const hasFiches = !!ficheExistenceData?.data?.length;
const { count: hasFiches } = useFicheActionCount();

/** Gère les fiches sélectionnées pour les actions groupées */
const handleSelectFiche = (fiche: FicheResume) => {
Expand Down

0 comments on commit bc6ce98

Please sign in to comment.