Changeset 057453c for src/api/service.ts


Ignore:
Timestamp:
02/26/25 10:05:32 (5 weeks ago)
Author:
Naum Shapkarovski <naumshapkarovski@…>
Branches:
main
Children:
299af01
Parents:
5d6f37a
Message:

feat: implement employees

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/api/service.ts

    r5d6f37a r057453c  
    11import { useMemo } from 'react';
    22// types
    3 import { Service } from 'mvpmasters-shared';
    4 // db
    5 import { collections, collectionFetcher as fetcher } from 'src/lib/firestore';
     3import { Service } from 'src/schemas';
    64// swr
    75import useSWR from 'swr';
     6import { endpoints, fetcher } from 'src/utils/axios';
    87
    98export function useGetServices() {
    10   const collectionName = collections.service;
    11 
    12   const { data, isLoading, error, isValidating } = useSWR(collectionName, fetcher<Service>, {
    13     revalidateOnFocus: false,
    14   });
     9  const { data, isLoading, error, isValidating } = useSWR<Service[]>(
     10    endpoints.service,
     11    () => fetcher<Service[]>(endpoints.service),
     12    {
     13      revalidateOnFocus: false,
     14    }
     15  );
    1516
    1617  const memoizedValue = useMemo(
Note: See TracChangeset for help on using the changeset viewer.