Jelajahi Sumber

removed unused APIs

Viktoriia 3 minggu lalu
induk
melakukan
39fb9ddc26

+ 0 - 1
src/contexts/RegionContext.tsx

@@ -3,7 +3,6 @@ import { usePostSetDareRegionMutation } from '@api/myDARE';
 import {
   usePostAddVisitMutation,
   usePostGetSingleRegionMutation,
-  usePostSetNmRegionMutation,
   usePostSetNotVisitedMutation
 } from '@api/myRegions';
 import React, { createContext, useContext, useState, useCallback } from 'react';

+ 0 - 2
src/modules/api/myRegions/queries/index.ts

@@ -1,6 +1,4 @@
 export * from './use-post-get-megaregions';
-export * from './use-post-get-regions-qe';
-export * from './use-post-set-update-nm';
 export * from './use-post-set-update-tcc';
 export * from './use-post-get-regions';
 export * from './use-post-get-visits-to-region';

+ 0 - 22
src/modules/api/myRegions/queries/use-post-get-regions-qe.tsx

@@ -1,22 +0,0 @@
-import { useQuery } from '@tanstack/react-query';
-
-import { regionsQueryKeys } from '../regions-query-keys';
-import { regionsApi, type PostGetRegionsQeReturn } from '../regions-api';
-
-import type { BaseAxiosError } from '../../../../types';
-
-export const useGetRegionQeQuery = (
-  megaregion: number | undefined,
-  country: number | undefined,
-  token: string,
-  enabled: boolean
-) => {
-  return useQuery<PostGetRegionsQeReturn, BaseAxiosError>({
-    queryKey: regionsQueryKeys.getRegionsQe(token, megaregion, country),
-    queryFn: async () => {
-      const response = await regionsApi.getRegionsQe(token, megaregion, country);
-      return response.data;
-    },
-    enabled
-  });
-};

+ 0 - 17
src/modules/api/myRegions/queries/use-post-set-update-nm.tsx

@@ -1,17 +0,0 @@
-import { useMutation } from '@tanstack/react-query';
-
-import { regionsQueryKeys } from '../regions-query-keys';
-import { type PostSetNmRegion, regionsApi } from '../regions-api';
-
-import type { BaseAxiosError } from '../../../../types';
-import { ResponseType } from '@api/response-type';
-
-export const usePostSetNmRegionMutation = () => {
-  return useMutation<ResponseType, BaseAxiosError, PostSetNmRegion, ResponseType>({
-    mutationKey: regionsQueryKeys.setNmRegion(),
-    mutationFn: async (data) => {
-      const response = await regionsApi.setNmRegion(data);
-      return response.data;
-    }
-  });
-};

+ 0 - 3
src/modules/api/myRegions/regions-api.tsx

@@ -161,9 +161,6 @@ export interface PostGetSingleRegionReturn {
 export const regionsApi = {
   getMegaregions: (token: string) =>
     request.postForm<PostGetMegaReturn>(API.GET_MEGAREGIONS, { token }),
-  getRegionsQe: (token: string, megaregion?: number, country?: number) =>
-    request.postForm<PostGetRegionsQeReturn>(API.GET_REGIONS_QE, { megaregion, country, token }),
-  setNmRegion: (data: PostSetNmRegion) => request.postForm<ResponseType>(API.SET_NM_REGION, data),
   setTCCRegion: (data: PostSetTCCRegion) =>
     request.postForm<ResponseType>(API.SET_TCC_REGION, data),
   getVisits: (token: string, region: number) =>

+ 0 - 3
src/modules/api/myRegions/regions-query-keys.tsx

@@ -1,8 +1,5 @@
 export const regionsQueryKeys = {
   getMegaregions: (token: string) => ['getMegaregions', { token }] as const,
-  getRegionsQe: (token: string, megaregion: number | undefined, country: number | undefined) =>
-    ['getRegionsQe', { megaregion, country, token }] as const,
-  setNmRegion: () => ['setNmRegion'] as const,
   setTCCRegion: () => ['setTCCRegion'] as const,
   getVisits: (token: string, region: number) => ['getVisits', { region, token }] as const,
   getRegions: (

+ 0 - 11
src/screens/InAppScreens/MapScreen/CountryViewScreen/index.tsx

@@ -34,7 +34,6 @@ import EditSvg from 'assets/icons/travels-screens/pen-to-square.svg';
 import CheckSvg from 'assets/icons/travels-screens/circle-check.svg';
 import CheckRegularSvg from 'assets/icons/travels-screens/circle-check-regular.svg';
 import MapSvg from 'assets/icons/travels-screens/map-location.svg';
-import { useGetRegionQeQuery } from '@api/myRegions';
 
 const CountryViewScreen: FC<Props> = ({ navigation, route }) => {
   const countryId = route.params?.regionId;
@@ -51,20 +50,10 @@ const CountryViewScreen: FC<Props> = ({ navigation, route }) => {
   const [name, setName] = useState('');
   const { data } = useGetCountryDataQuery(countryId, true, token && token);
   // const { mutateAsync: mutateCountriesData } = fetchCountryUserData();
-  // const { data: regionsQe } = useGetRegionQeQuery(undefined, countryId, String(token), true);
   const { mutate: updateSeriesItem } = usePostSetToggleItem();
   const [isInfoModalVisible, setIsInfoModalVisible] = useState<boolean>(false);
   const [infoItem, setInfoItem] = useState<SeriesItem | null>(null);
   const [isEditSlowModalVisible, setIsEditSlowModalVisible] = useState<boolean>(false);
-  // const [regionsData, setRegionsData] = useState<any>(null);
-  // const [daresData, setDaresData] = useState<any>(null);
-
-  // const [index, setIndex] = useState<number>(0);
-  // const [countryRoutes] = useState([
-  //   { key: 'regions', title: 'NM regions' },
-  //   { key: 'dare', title: 'DARE places' },
-  //   { key: 'series', title: 'Series' }
-  // ]);
 
   const {
     handleUpdateSlow: updateSlow,

+ 0 - 1
src/screens/InAppScreens/TravelsScreen/EditCountryDataScreen/index.tsx

@@ -12,7 +12,6 @@ import { NmRegion } from '../utils/types';
 import { Colors } from 'src/theme';
 import { styles } from './styles';
 import {
-  useGetRegionQeQuery,
   useGetRegionsQuery,
   usePostSetTCCRegionMutation
 } from '@api/myRegions';

+ 0 - 6
src/types/api.ts

@@ -76,8 +76,6 @@ export enum API_ENDPOINT {
   GET_SLOW = 'get-slow-app',
   SET_SLOW = 'set-slow',
   GET_MEGAREGIONS = 'get-megaregions',
-  GET_REGIONS_QE = 'get-regions-qe',
-  SET_NM_REGION = 'updateNM',
   SET_TCC_REGION = 'updateTCC',
   GET_MEGAREGIONS_DARE = 'get-megaregions-dare',
   GET_REGIONS_DARE = 'get-regions-dare',
@@ -94,7 +92,6 @@ export enum API_ENDPOINT {
   GET_LAST_MAP_TILES_UPDATE = 'last-map-tiles-update',
   GET_PROFILE_REGIONS = 'get-profile',
   GET_UNIVERSAL = 'universal',
-  GET_REGIONS_DATA = 'get-app-region-screen-data',
   GET_NM_REGION_DATA = 'get-nm-region-screen-data',
   GET_DARE_REGION_DATA = 'get-dare-region-screen-data',
   GET_USERS_FROM_REGION = 'get-users-from-region',
@@ -276,8 +273,6 @@ export enum API {
   GET_SLOW = `${API_ROUTE.SLOW}/${API_ENDPOINT.GET_SLOW}`,
   SET_SLOW = `${API_ROUTE.SLOW}/${API_ENDPOINT.SET_SLOW}`,
   GET_MEGAREGIONS = `${API_ROUTE.REGIONS}/${API_ENDPOINT.GET_MEGAREGIONS}`,
-  GET_REGIONS_QE = `${API_ROUTE.REGIONS}/${API_ENDPOINT.GET_REGIONS_QE}`,
-  SET_NM_REGION = `${API_ROUTE.QUICK_ENTER}/${API_ENDPOINT.SET_NM_REGION}`,
   SET_TCC_REGION = `${API_ROUTE.QUICK_ENTER}/${API_ENDPOINT.SET_TCC_REGION}`,
   GET_MEGAREGIONS_DARE = `${API_ROUTE.REGIONS}/${API_ENDPOINT.GET_MEGAREGIONS_DARE}`,
   GET_REGIONS_DARE = `${API_ROUTE.REGIONS}/${API_ENDPOINT.GET_REGIONS_DARE}`,
@@ -294,7 +289,6 @@ export enum API {
   GET_LAST_MAP_TILES_UPDATE = `${API_ROUTE.APP}/${API_ENDPOINT.GET_LAST_MAP_TILES_UPDATE}`,
   GET_PROFILE_REGIONS = `${API_ROUTE.REGIONS}/${API_ENDPOINT.GET_PROFILE_REGIONS}`,
   GET_UNIVERSAL = `${API_ROUTE.SEARCH}/${API_ENDPOINT.GET_UNIVERSAL}`,
-  GET_REGIONS_DATA = `${API_ROUTE.REGIONS}/${API_ENDPOINT.GET_REGIONS_DATA}`,
   GET_NM_REGION_DATA = `${API_ROUTE.REGIONS}/${API_ENDPOINT.GET_NM_REGION_DATA}`,
   GET_DARE_REGION_DATA = `${API_ROUTE.REGIONS}/${API_ENDPOINT.GET_DARE_REGION_DATA}`,
   GET_USERS_FROM_REGION = `${API_ROUTE.REGIONS}/${API_ENDPOINT.GET_USERS_FROM_REGION}`,