aboutsummaryrefslogtreecommitdiff
path: root/src/utils/search.ts
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-03-26 22:40:00 -0400
committerIvan Chen <ivan@tagg.id>2021-03-26 22:40:00 -0400
commit64785e6527e521ce14e32edcc80adc6253b48657 (patch)
treedf42bdbe6810b589ec52c98fcd622cc7e2864879 /src/utils/search.ts
parented26661062a2e47df2662254eaddfcfa1de62d04 (diff)
renamed to UniversityType, applied to all
Diffstat (limited to 'src/utils/search.ts')
-rw-r--r--src/utils/search.ts16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/utils/search.ts b/src/utils/search.ts
index aa9a7463..26f40b1b 100644
--- a/src/utils/search.ts
+++ b/src/utils/search.ts
@@ -1,12 +1,16 @@
import AsyncStorage from '@react-native-community/async-storage';
import {BADGE_DATA} from '../constants/badges';
-import {ProfilePreviewType, CategoryPreviewType, Universities} from '../types';
+import {
+ ProfilePreviewType,
+ CategoryPreviewType,
+ UniversityType,
+} from '../types';
/*
* Gets all possible search suggestions.
*/
-export const getSearchSuggestions = (university : Universities): string[] => {
+export const getSearchSuggestions = (university: UniversityType): string[] => {
const suggestions: string[] = [];
for (const category of BADGE_DATA[university]) {
for (const interest of category.data) {
@@ -62,7 +66,9 @@ export const getRecentlySearchedUsers = async (): Promise<
> => {
try {
const usersJSON = await AsyncStorage.getItem(recentlySearchedUsersKey);
- if (usersJSON) return JSON.parse(usersJSON);
+ if (usersJSON) {
+ return JSON.parse(usersJSON);
+ }
} catch (e) {
console.log(e);
}
@@ -124,7 +130,9 @@ export const getRecentlySearchedCategories = async (): Promise<
const categoriesJSON = await AsyncStorage.getItem(
'@recently_searched_categories',
);
- if (categoriesJSON) return JSON.parse(categoriesJSON);
+ if (categoriesJSON) {
+ return JSON.parse(categoriesJSON);
+ }
} catch (e) {
console.log(e);
}