diff options
author | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-04-09 11:14:46 -0700 |
---|---|---|
committer | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-04-09 11:14:46 -0700 |
commit | c8d5992ca659a1984194718703dd1b036e1fb59e (patch) | |
tree | 7bab7338e368b7445d4d51c667d36a956c404856 | |
parent | c54a25dc05eeb70780bc3a3ec05cb8cbed3f334b (diff) |
Changes for default suggested
-rw-r--r-- | src/constants/api.ts | 24 | ||||
-rw-r--r-- | src/screens/chat/NewChatModal.tsx | 9 | ||||
-rw-r--r-- | src/screens/search/SearchScreen.tsx | 4 |
3 files changed, 23 insertions, 14 deletions
diff --git a/src/constants/api.ts b/src/constants/api.ts index ef33631a..43294386 100644 --- a/src/constants/api.ts +++ b/src/constants/api.ts @@ -2,7 +2,7 @@ // Dev const BASE_URL: string = 'http://127.0.0.1:8000/'; -export const STREAM_CHAT_API = 'g2hvnyqx9cmv' +export const STREAM_CHAT_API = 'g2hvnyqx9cmv'; // Prod // const BASE_URL: string = 'http://app-prod.tagg.id/'; @@ -25,7 +25,8 @@ export const GET_IG_POSTS_ENDPOINT: string = API_URL + 'posts-ig/'; export const GET_FB_POSTS_ENDPOINT: string = API_URL + 'posts-fb/'; export const GET_TWITTER_POSTS_ENDPOINT: string = API_URL + 'posts-twitter/'; export const SEARCH_ENDPOINT: string = API_URL + 'search/'; -export const SEARCH_ENDPOINT_V2: string = API_URL + 'search/v2/'; +export const SEARCH_ENDPOINT_MESSAGES: string = API_URL + 'search/messages/'; +export const SEARCH_ENDPOINT_SUGGESTED: string = API_URL + 'search/suggested/'; export const MOMENTS_ENDPOINT: string = API_URL + 'moments/'; export const MOMENT_THUMBNAIL_ENDPOINT: string = API_URL + 'moment-thumbnail/'; export const VERIFY_INVITATION_CODE_ENDPOUNT: string = API_URL + 'verify-code/'; @@ -38,20 +39,24 @@ export const PASSWORD_RESET_ENDPOINT: string = API_URL + 'password-reset/'; export const MOMENT_CATEGORY_ENDPOINT: string = API_URL + 'moment-category/'; export const NOTIFICATIONS_ENDPOINT: string = API_URL + 'notifications/'; export const DISCOVER_ENDPOINT: string = API_URL + 'discover/'; -export const SEARCH_BUTTONS_ENDPOPINT: string = DISCOVER_ENDPOINT + 'search_buttons/'; +export const SEARCH_BUTTONS_ENDPOPINT: string = + DISCOVER_ENDPOINT + 'search_buttons/'; export const WAITLIST_USER_ENDPOINT: string = API_URL + 'waitlist-user/'; export const COMMENT_THREAD_ENDPOINT: string = API_URL + 'reply/'; export const USERS_FROM_CONTACTS_ENDPOINT: string = API_URL + 'user_contacts/find_friends/'; export const INVITE_FRIEND_ENDPOINT: string = -API_URL + 'user_contacts/invite_friend/'; + API_URL + 'user_contacts/invite_friend/'; // Suggested People export const SP_USERS_ENDPOINT: string = API_URL + 'suggested_people/'; -export const SP_UPDATE_PICTURE_ENDPOINT: string = SP_USERS_ENDPOINT + 'update_picture/'; -export const SP_MUTUAL_BADGE_HOLDERS_ENDPOINT: string = SP_USERS_ENDPOINT + 'get_mutual_badge_holders/'; +export const SP_UPDATE_PICTURE_ENDPOINT: string = + SP_USERS_ENDPOINT + 'update_picture/'; +export const SP_MUTUAL_BADGE_HOLDERS_ENDPOINT: string = + SP_USERS_ENDPOINT + 'get_mutual_badge_holders/'; export const ADD_BADGES_ENDPOINT: string = SP_USERS_ENDPOINT + 'add_badges/'; -export const UPDATE_BADGES_ENDPOINT: string = SP_USERS_ENDPOINT + 'update_badges/'; +export const UPDATE_BADGES_ENDPOINT: string = + SP_USERS_ENDPOINT + 'update_badges/'; // Register as FCM device export const FCM_ENDPOINT: string = API_URL + 'fcm/'; @@ -72,6 +77,7 @@ export const LINK_IG_OAUTH: string = `https://www.instagram.com/oauth/authorize/ export const LINK_FB_OAUTH: string = `https://www.facebook.com/v8.0/dialog/oauth?client_id=1308555659343609&redirect_uri=${DEEPLINK}&scope=user_posts,public_profile&response_type=code`; export const LINK_TWITTER_OAUTH: string = API_URL + 'link-twitter-request/'; -// Profile Links -export const COMMUNITY_GUIDELINES: string = 'https://www.tagg.id/community-guidelines'; +// Profile Links +export const COMMUNITY_GUIDELINES: string = + 'https://www.tagg.id/community-guidelines'; export const PRIVACY_POLICY: string = 'https://www.tagg.id/privacy-policy'; diff --git a/src/screens/chat/NewChatModal.tsx b/src/screens/chat/NewChatModal.tsx index a7754d3a..95e46ecd 100644 --- a/src/screens/chat/NewChatModal.tsx +++ b/src/screens/chat/NewChatModal.tsx @@ -9,7 +9,10 @@ import { } from 'react-native'; import {useSharedValue} from 'react-native-reanimated'; import {BottomDrawer} from '../../components'; -import {SEARCH_ENDPOINT} from '../../constants'; +import { + SEARCH_ENDPOINT_MESSAGES, + SEARCH_ENDPOINT_SUGGESTED, +} from '../../constants'; import {loadSearchResults} from '../../services'; import {ScreenType} from '../../types'; import {normalize} from '../../utils'; @@ -42,7 +45,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({ const getDefaultSuggested = async () => { const searchResults = await loadSearchResults( - `${SEARCH_ENDPOINT}?query=&requestType=suggested`, + `${SEARCH_ENDPOINT_SUGGESTED}`, ); console.log(searchResults); const sanitizedResult = [ @@ -57,7 +60,7 @@ const NewChatModal: React.FC<NewChatModalProps> = ({ const getQuerySuggested = async () => { const searchResults = await loadSearchResults( - `${SEARCH_ENDPOINT}?query=${query}&requestType='search'`, + `${SEARCH_ENDPOINT_MESSAGES}?query=${query}`, ); if (query.length > 2) { const sanitizedResult = [ diff --git a/src/screens/search/SearchScreen.tsx b/src/screens/search/SearchScreen.tsx index 6d8e4848..f7e1c467 100644 --- a/src/screens/search/SearchScreen.tsx +++ b/src/screens/search/SearchScreen.tsx @@ -24,7 +24,7 @@ import { SearchResultsBackground, TabsGradient, } from '../../components'; -import {SEARCH_ENDPOINT_V2} from '../../constants'; +import {SEARCH_ENDPOINT} from '../../constants'; import {loadSearchResults} from '../../services'; import {resetScreenType} from '../../store/actions'; import {RootState} from '../../store/rootReducer'; @@ -71,7 +71,7 @@ const SearchScreen: React.FC = () => { } (async () => { const searchResults = await loadSearchResults( - `${SEARCH_ENDPOINT_V2}?query=${query}`, + `${SEARCH_ENDPOINT}?query=${query}`, ); if (query.length > 2) { const sanitizedResult = [ |