@@ -28,11 +28,12 @@ import { Button } from '@/components/Button';
2828import { CertifiedIcon } from '@/components/Icons' ;
2929// WarningIcon
3030import { ArrowTopRightOnSquareIcon } from '@/components/Icons' ;
31+ import useListFetcher from '@/hooks/useListFetcher' ;
3132
3233import { useAuthGuard } from '#/domain/auth/hooks' ;
3334import { isBountyApplied } from '#/domain/bounty/helper' ;
35+ import { fetchBuilderList } from '#/domain/bounty/repository' ;
3436import CompleteProfileDialogWidget from '#/domain/profile/widgets/complete-profile-dialog' ;
35- import { useBountyBuildersList } from '#/services/bounties/hooks' ;
3637import { useMediaUrl , useUser } from '#/state/application/hooks' ;
3738
3839import { revalidatePathAction } from '../../actions' ;
@@ -72,8 +73,7 @@ export function Employers({ id, list, data, mobile }) {
7273 const [ notComplete , setNotComplete ] = useState ( false ) ;
7374 const mediaUrl = useMediaUrl ( ) ;
7475 const user = useUser ( ) ;
75- //const wrapBountyEnvCheck = useBountyEnvCheck();
76- const { loading : buildersLoading , list : builderList = [ ] , doFetch } = useBountyBuildersList ( id ) ;
76+ const { loading : buildersLoading , response, refetch } = useListFetcher ( fetchBuilderList , id ) ;
7777 const { withAuth } = useAuthGuard ( ) ;
7878
7979 const apply = ( ) => {
@@ -108,10 +108,10 @@ export function Employers({ id, list, data, mobile }) {
108108 }
109109 } ;
110110
111- const currentUserApplied = ! buildersLoading && builderList . some ( ( { builder_uid } ) => builder_uid === user ?. base . user_id ) ;
111+ const currentUserApplied = ! buildersLoading && ( response ?. data ?. list || [ ] ) . some ( ( { builder_uid } ) => builder_uid === user ?. base . user_id ) ;
112112 const handleApplyDialogClose = ( ) => {
113113 setOpenModal ( false ) ;
114- doFetch ( ) ;
114+ refetch ( ) ;
115115 } ;
116116
117117 return (
0 commit comments