diff --git a/hotel-management/src/App.tsx b/hotel-management/src/App.tsx index c1d0c07..347ed1b 100644 --- a/hotel-management/src/App.tsx +++ b/hotel-management/src/App.tsx @@ -19,6 +19,8 @@ import { reducer, } from '@context/UserRoomAvailableContext'; import { useEffect, useReducer } from 'react'; + +// Services import { getUserNotBooked } from '@service/userServices'; import { getRoomsAvailable } from '@service/roomServices'; @@ -26,8 +28,8 @@ const queryClient = new QueryClient({ defaultOptions: { queries: { staleTime: 60 * 1000, - } - } + }, + }, }); function App() { @@ -64,7 +66,10 @@ function App() { }> - } /> + } + /> } /> } /> } /> diff --git a/hotel-management/src/hooks/rooms/useCreateRoom.ts b/hotel-management/src/hooks/rooms/useCreateRoom.ts index 7578bd6..045cd10 100644 --- a/hotel-management/src/hooks/rooms/useCreateRoom.ts +++ b/hotel-management/src/hooks/rooms/useCreateRoom.ts @@ -6,6 +6,8 @@ import { createRoom as createRoomFn } from '@service/roomServices'; // Constants import { ADD_SUCCESS } from '@constant/messages'; + +// Hooks import { useUserRoomAvailable } from '@hook/useUserRoomAvailable'; /** diff --git a/hotel-management/src/hooks/rooms/useUpdateRoom.ts b/hotel-management/src/hooks/rooms/useUpdateRoom.ts index 7b1bf15..6b6d6e6 100644 --- a/hotel-management/src/hooks/rooms/useUpdateRoom.ts +++ b/hotel-management/src/hooks/rooms/useUpdateRoom.ts @@ -6,6 +6,8 @@ import { updateRoom as updateRoomFn } from '@service/roomServices'; // Constants import { UPDATE_SUCCESS } from '@constant/messages'; + +// Hooks import { useUserRoomAvailable } from '@hook/useUserRoomAvailable'; /** diff --git a/hotel-management/src/hooks/useUserRoomAvailable.ts b/hotel-management/src/hooks/useUserRoomAvailable.ts index 18ae1e3..e362b9d 100644 --- a/hotel-management/src/hooks/useUserRoomAvailable.ts +++ b/hotel-management/src/hooks/useUserRoomAvailable.ts @@ -1,6 +1,8 @@ -import { UserRoomAvailableContext } from '@context/UserRoomAvailableContext'; import { useContext } from 'react'; +// Contexts +import { UserRoomAvailableContext } from '@context/UserRoomAvailableContext'; + const useUserRoomAvailable = () => { const context = useContext(UserRoomAvailableContext); diff --git a/hotel-management/src/hooks/users/useCreateUser.ts b/hotel-management/src/hooks/users/useCreateUser.ts index 7d7c8e3..7f89db0 100644 --- a/hotel-management/src/hooks/users/useCreateUser.ts +++ b/hotel-management/src/hooks/users/useCreateUser.ts @@ -6,6 +6,8 @@ import { createUser as createUserFn } from '@service/userServices'; // Constants import { ADD_SUCCESS } from '@constant/messages'; + +// Hooks import { useUserRoomAvailable } from '@hook/useUserRoomAvailable'; /** diff --git a/hotel-management/src/hooks/users/useUpdateUser.ts b/hotel-management/src/hooks/users/useUpdateUser.ts index 6603c8d..3c4a029 100644 --- a/hotel-management/src/hooks/users/useUpdateUser.ts +++ b/hotel-management/src/hooks/users/useUpdateUser.ts @@ -6,6 +6,8 @@ import { updateUser as updateUserFn } from '@service/userServices'; // Messages import { UPDATE_SUCCESS } from '@constant/messages'; + +// Hooks import { useUserRoomAvailable } from '@hook/useUserRoomAvailable'; /** diff --git a/hotel-management/src/pages/Dashboard.tsx b/hotel-management/src/pages/Dashboard.tsx index 94d877b..592fd32 100644 --- a/hotel-management/src/pages/Dashboard.tsx +++ b/hotel-management/src/pages/Dashboard.tsx @@ -1,6 +1,8 @@ -import { useUserRoomAvailable } from '@hook/useUserRoomAvailable'; import styled from 'styled-components'; +// Hooks +import { useUserRoomAvailable } from '@hook/useUserRoomAvailable'; + const StyledDashboard = styled.main` padding: 20px; `; diff --git a/hotel-management/src/services/roomServices.ts b/hotel-management/src/services/roomServices.ts index e335cfb..ed0a843 100644 --- a/hotel-management/src/services/roomServices.ts +++ b/hotel-management/src/services/roomServices.ts @@ -1,9 +1,9 @@ // Types import { IRoom } from '@type/rooms'; +import { IDataState } from '@type/common'; // Services import supabase from './supabaseService'; -import { IDataState } from '@type/common'; // Constants const ROOMS_TABLE = 'rooms'; diff --git a/hotel-management/src/services/userServices.ts b/hotel-management/src/services/userServices.ts index da3ff70..62d2fc9 100644 --- a/hotel-management/src/services/userServices.ts +++ b/hotel-management/src/services/userServices.ts @@ -1,9 +1,9 @@ // Types import { IUser } from '@type/users'; +import { IDataState } from '@type/common'; // Services import supabase from './supabaseService'; -import { IDataState } from '@type/common'; const USERS_TABLE = 'users'; const ERROR_FETCHING = "Users can't be loaded!";