diff options
Diffstat (limited to 'frontend/src/api')
| -rw-r--r-- | frontend/src/api/Api.ts | 18 | ||||
| -rw-r--r-- | frontend/src/api/Auth.ts | 8 | ||||
| -rw-r--r-- | frontend/src/api/Games.ts | 28 | ||||
| -rw-r--r-- | frontend/src/api/Maps.ts | 160 | ||||
| -rw-r--r-- | frontend/src/api/Mod.ts | 104 | ||||
| -rw-r--r-- | frontend/src/api/Rankings.ts | 6 | ||||
| -rw-r--r-- | frontend/src/api/User.ts | 6 |
7 files changed, 211 insertions, 119 deletions
diff --git a/frontend/src/api/Api.ts b/frontend/src/api/Api.ts index 0e1658c..b98dda3 100644 --- a/frontend/src/api/Api.ts +++ b/frontend/src/api/Api.ts | |||
| @@ -1,14 +1,14 @@ | |||
| 1 | import { MapDiscussionContent, ModMenuContent } from "@customTypes/Content"; | 1 | import { MapDiscussionContent, ModMenuContent } from '@customTypes/Content'; |
| 2 | import { delete_token, get_token } from "@api/Auth"; | 2 | import { delete_token, get_token } from '@api/Auth'; |
| 3 | import { get_user, get_profile, post_profile } from "@api/User"; | 3 | import { get_user, get_profile, post_profile } from '@api/User'; |
| 4 | import { | 4 | import { |
| 5 | get_games, | 5 | get_games, |
| 6 | get_chapters, | 6 | get_chapters, |
| 7 | get_games_chapters, | 7 | get_games_chapters, |
| 8 | get_game_maps, | 8 | get_game_maps, |
| 9 | get_search, | 9 | get_search, |
| 10 | } from "@api/Games"; | 10 | } from '@api/Games'; |
| 11 | import { get_official_rankings, get_unofficial_rankings } from "@api/Rankings"; | 11 | import { get_official_rankings, get_unofficial_rankings } from '@api/Rankings'; |
| 12 | import { | 12 | import { |
| 13 | get_map_summary, | 13 | get_map_summary, |
| 14 | get_map_leaderboard, | 14 | get_map_leaderboard, |
| @@ -19,14 +19,14 @@ import { | |||
| 19 | delete_map_discussion, | 19 | delete_map_discussion, |
| 20 | post_record, | 20 | post_record, |
| 21 | delete_map_record, | 21 | delete_map_record, |
| 22 | } from "@api/Maps"; | 22 | } from '@api/Maps'; |
| 23 | import { | 23 | import { |
| 24 | delete_map_summary, | 24 | delete_map_summary, |
| 25 | post_map_summary, | 25 | post_map_summary, |
| 26 | put_map_image, | 26 | put_map_image, |
| 27 | put_map_summary, | 27 | put_map_summary, |
| 28 | } from "@api/Mod"; | 28 | } from '@api/Mod'; |
| 29 | import { UploadRunContent } from "@customTypes/Content"; | 29 | import { UploadRunContent } from '@customTypes/Content'; |
| 30 | 30 | ||
| 31 | // add new api call function entries here | 31 | // add new api call function entries here |
| 32 | // example usage: API.get_games(); | 32 | // example usage: API.get_games(); |
| @@ -91,7 +91,7 @@ export const API = { | |||
| 91 | delete_map_summary(token, map_id, route_id), | 91 | delete_map_summary(token, map_id, route_id), |
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | const BASE_API_URL: string = "/api/v1/"; | 94 | const BASE_API_URL: string = '/api/v1/'; |
| 95 | 95 | ||
| 96 | export function url(path: string): string { | 96 | export function url(path: string): string { |
| 97 | return BASE_API_URL + path; | 97 | return BASE_API_URL + path; |
diff --git a/frontend/src/api/Auth.ts b/frontend/src/api/Auth.ts index 875c7e5..e495d47 100644 --- a/frontend/src/api/Auth.ts +++ b/frontend/src/api/Auth.ts | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from 'axios'; |
| 2 | import { url } from "@api/Api"; | 2 | import { url } from '@api/Api'; |
| 3 | 3 | ||
| 4 | export const get_token = async (): Promise<string | undefined> => { | 4 | export const get_token = async (): Promise<string | undefined> => { |
| 5 | const response = await axios.get(url(`token`)) | 5 | const response = await axios.get(url(`token`)); |
| 6 | if (!response.data.success) { | 6 | if (!response.data.success) { |
| 7 | return undefined; | 7 | return undefined; |
| 8 | } | 8 | } |
| @@ -10,5 +10,5 @@ export const get_token = async (): Promise<string | undefined> => { | |||
| 10 | }; | 10 | }; |
| 11 | 11 | ||
| 12 | export const delete_token = async () => { | 12 | export const delete_token = async () => { |
| 13 | await axios.delete(url("token")); | 13 | await axios.delete(url('token')); |
| 14 | }; | 14 | }; |
diff --git a/frontend/src/api/Games.ts b/frontend/src/api/Games.ts index 72bb4b3..0e47091 100644 --- a/frontend/src/api/Games.ts +++ b/frontend/src/api/Games.ts | |||
| @@ -1,31 +1,35 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from 'axios'; |
| 2 | import { url } from "@api/Api"; | 2 | import { url } from '@api/Api'; |
| 3 | import { GameChapter, GamesChapters } from "@customTypes/Chapters"; | 3 | import { GameChapter, GamesChapters } from '@customTypes/Chapters'; |
| 4 | import { Game } from "@customTypes/Game"; | 4 | import { Game } from '@customTypes/Game'; |
| 5 | import { Map } from "@customTypes/Map"; | 5 | import { Map } from '@customTypes/Map'; |
| 6 | import { Search } from "@customTypes/Search"; | 6 | import { Search } from '@customTypes/Search'; |
| 7 | 7 | ||
| 8 | export const get_games = async (): Promise<Game[]> => { | 8 | export const get_games = async (): Promise<Game[]> => { |
| 9 | const response = await axios.get(url(`games`)) | 9 | const response = await axios.get(url(`games`)); |
| 10 | return response.data.data; | 10 | return response.data.data; |
| 11 | }; | 11 | }; |
| 12 | 12 | ||
| 13 | export const get_chapters = async (chapter_id: string): Promise<GameChapter> => { | 13 | export const get_chapters = async ( |
| 14 | chapter_id: string | ||
| 15 | ): Promise<GameChapter> => { | ||
| 14 | const response = await axios.get(url(`chapters/${chapter_id}`)); | 16 | const response = await axios.get(url(`chapters/${chapter_id}`)); |
| 15 | return response.data.data; | 17 | return response.data.data; |
| 16 | } | 18 | }; |
| 17 | 19 | ||
| 18 | export const get_games_chapters = async (game_id: string): Promise<GamesChapters> => { | 20 | export const get_games_chapters = async ( |
| 21 | game_id: string | ||
| 22 | ): Promise<GamesChapters> => { | ||
| 19 | const response = await axios.get(url(`games/${game_id}`)); | 23 | const response = await axios.get(url(`games/${game_id}`)); |
| 20 | return response.data.data; | 24 | return response.data.data; |
| 21 | }; | 25 | }; |
| 22 | 26 | ||
| 23 | export const get_game_maps = async (game_id: string): Promise<Map[]> => { | 27 | export const get_game_maps = async (game_id: string): Promise<Map[]> => { |
| 24 | const response = await axios.get(url(`games/${game_id}/maps`)) | 28 | const response = await axios.get(url(`games/${game_id}/maps`)); |
| 25 | return response.data.data.maps; | 29 | return response.data.data.maps; |
| 26 | }; | 30 | }; |
| 27 | 31 | ||
| 28 | export const get_search = async (q: string): Promise<Search> => { | 32 | export const get_search = async (q: string): Promise<Search> => { |
| 29 | const response = await axios.get(url(`search?q=${q}`)) | 33 | const response = await axios.get(url(`search?q=${q}`)); |
| 30 | return response.data.data; | 34 | return response.data.data; |
| 31 | }; | 35 | }; |
diff --git a/frontend/src/api/Maps.ts b/frontend/src/api/Maps.ts index aa967ce..3a22f88 100644 --- a/frontend/src/api/Maps.ts +++ b/frontend/src/api/Maps.ts | |||
| @@ -1,15 +1,25 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from 'axios'; |
| 2 | import { url } from "@api/Api"; | 2 | import { url } from '@api/Api'; |
| 3 | import { MapDiscussionContent, UploadRunContent } from "@customTypes/Content"; | 3 | import { MapDiscussionContent, UploadRunContent } from '@customTypes/Content'; |
| 4 | import { MapSummary, MapLeaderboard, MapDiscussions, MapDiscussion } from "@customTypes/Map"; | 4 | import { |
| 5 | MapSummary, | ||
| 6 | MapLeaderboard, | ||
| 7 | MapDiscussions, | ||
| 8 | MapDiscussion, | ||
| 9 | } from '@customTypes/Map'; | ||
| 5 | 10 | ||
| 6 | export const get_map_summary = async (map_id: string): Promise<MapSummary> => { | 11 | export const get_map_summary = async (map_id: string): Promise<MapSummary> => { |
| 7 | const response = await axios.get(url(`maps/${map_id}/summary`)) | 12 | const response = await axios.get(url(`maps/${map_id}/summary`)); |
| 8 | return response.data.data; | 13 | return response.data.data; |
| 9 | }; | 14 | }; |
| 10 | 15 | ||
| 11 | export const get_map_leaderboard = async (map_id: string, page: string): Promise<MapLeaderboard | undefined> => { | 16 | export const get_map_leaderboard = async ( |
| 12 | const response = await axios.get(url(`maps/${map_id}/leaderboards?page=${page}`)); | 17 | map_id: string, |
| 18 | page: string | ||
| 19 | ): Promise<MapLeaderboard | undefined> => { | ||
| 20 | const response = await axios.get( | ||
| 21 | url(`maps/${map_id}/leaderboards?page=${page}`) | ||
| 22 | ); | ||
| 13 | if (!response.data.success) { | 23 | if (!response.data.success) { |
| 14 | return undefined; | 24 | return undefined; |
| 15 | } | 25 | } |
| @@ -25,7 +35,9 @@ export const get_map_leaderboard = async (map_id: string, page: string): Promise | |||
| 25 | return data; | 35 | return data; |
| 26 | }; | 36 | }; |
| 27 | 37 | ||
| 28 | export const get_map_discussions = async (map_id: string): Promise<MapDiscussions | undefined> => { | 38 | export const get_map_discussions = async ( |
| 39 | map_id: string | ||
| 40 | ): Promise<MapDiscussions | undefined> => { | ||
| 29 | const response = await axios.get(url(`maps/${map_id}/discussions`)); | 41 | const response = await axios.get(url(`maps/${map_id}/discussions`)); |
| 30 | if (!response.data.data.discussions) { | 42 | if (!response.data.data.discussions) { |
| 31 | return undefined; | 43 | return undefined; |
| @@ -33,74 +45,122 @@ export const get_map_discussions = async (map_id: string): Promise<MapDiscussion | |||
| 33 | return response.data.data; | 45 | return response.data.data; |
| 34 | }; | 46 | }; |
| 35 | 47 | ||
| 36 | export const get_map_discussion = async (map_id: string, discussion_id: number): Promise<MapDiscussion | undefined> => { | 48 | export const get_map_discussion = async ( |
| 37 | const response = await axios.get(url(`maps/${map_id}/discussions/${discussion_id}`)); | 49 | map_id: string, |
| 50 | discussion_id: number | ||
| 51 | ): Promise<MapDiscussion | undefined> => { | ||
| 52 | const response = await axios.get( | ||
| 53 | url(`maps/${map_id}/discussions/${discussion_id}`) | ||
| 54 | ); | ||
| 38 | if (!response.data.data.discussion) { | 55 | if (!response.data.data.discussion) { |
| 39 | return undefined; | 56 | return undefined; |
| 40 | } | 57 | } |
| 41 | return response.data.data; | 58 | return response.data.data; |
| 42 | }; | 59 | }; |
| 43 | 60 | ||
| 44 | export const post_map_discussion = async (token: string, map_id: string, content: MapDiscussionContent): Promise<boolean> => { | 61 | export const post_map_discussion = async ( |
| 45 | const response = await axios.post(url(`maps/${map_id}/discussions`), { | 62 | token: string, |
| 46 | "title": content.title, | 63 | map_id: string, |
| 47 | "content": content.content, | 64 | content: MapDiscussionContent |
| 48 | }, { | 65 | ): Promise<boolean> => { |
| 49 | headers: { | 66 | const response = await axios.post( |
| 50 | "Authorization": token, | 67 | url(`maps/${map_id}/discussions`), |
| 68 | { | ||
| 69 | title: content.title, | ||
| 70 | content: content.content, | ||
| 71 | }, | ||
| 72 | { | ||
| 73 | headers: { | ||
| 74 | Authorization: token, | ||
| 75 | }, | ||
| 51 | } | 76 | } |
| 52 | }); | 77 | ); |
| 53 | return response.data.success; | 78 | return response.data.success; |
| 54 | }; | 79 | }; |
| 55 | 80 | ||
| 56 | export const post_map_discussion_comment = async (token: string, map_id: string, discussion_id: number, comment: string): Promise<boolean> => { | 81 | export const post_map_discussion_comment = async ( |
| 57 | const response = await axios.post(url(`maps/${map_id}/discussions/${discussion_id}`), { | 82 | token: string, |
| 58 | "comment": comment, | 83 | map_id: string, |
| 59 | }, { | 84 | discussion_id: number, |
| 60 | headers: { | 85 | comment: string |
| 61 | "Authorization": token, | 86 | ): Promise<boolean> => { |
| 87 | const response = await axios.post( | ||
| 88 | url(`maps/${map_id}/discussions/${discussion_id}`), | ||
| 89 | { | ||
| 90 | comment: comment, | ||
| 91 | }, | ||
| 92 | { | ||
| 93 | headers: { | ||
| 94 | Authorization: token, | ||
| 95 | }, | ||
| 62 | } | 96 | } |
| 63 | }); | 97 | ); |
| 64 | return response.data.success; | 98 | return response.data.success; |
| 65 | }; | 99 | }; |
| 66 | 100 | ||
| 67 | export const delete_map_discussion = async (token: string, map_id: string, discussion_id: number): Promise<boolean> => { | 101 | export const delete_map_discussion = async ( |
| 68 | const response = await axios.delete(url(`maps/${map_id}/discussions/${discussion_id}`), { | 102 | token: string, |
| 69 | headers: { | 103 | map_id: string, |
| 70 | "Authorization": token, | 104 | discussion_id: number |
| 105 | ): Promise<boolean> => { | ||
| 106 | const response = await axios.delete( | ||
| 107 | url(`maps/${map_id}/discussions/${discussion_id}`), | ||
| 108 | { | ||
| 109 | headers: { | ||
| 110 | Authorization: token, | ||
| 111 | }, | ||
| 71 | } | 112 | } |
| 72 | }); | 113 | ); |
| 73 | return response.data.success; | 114 | return response.data.success; |
| 74 | }; | 115 | }; |
| 75 | 116 | ||
| 76 | export const post_record = async (token: string, run: UploadRunContent, map_id: number): Promise<[boolean, string]> => { | 117 | export const post_record = async ( |
| 118 | token: string, | ||
| 119 | run: UploadRunContent, | ||
| 120 | map_id: number | ||
| 121 | ): Promise<[boolean, string]> => { | ||
| 77 | if (run.partner_demo) { | 122 | if (run.partner_demo) { |
| 78 | const response = await axios.postForm(url(`maps/${map_id}/record`), { | 123 | const response = await axios.postForm( |
| 79 | "host_demo": run.host_demo, | 124 | url(`maps/${map_id}/record`), |
| 80 | "partner_demo": run.partner_demo, | 125 | { |
| 81 | }, { | 126 | host_demo: run.host_demo, |
| 82 | headers: { | 127 | partner_demo: run.partner_demo, |
| 83 | "Authorization": token, | 128 | }, |
| 129 | { | ||
| 130 | headers: { | ||
| 131 | Authorization: token, | ||
| 132 | }, | ||
| 84 | } | 133 | } |
| 85 | }); | 134 | ); |
| 86 | return [response.data.success, response.data.message]; | 135 | return [response.data.success, response.data.message]; |
| 87 | } else { | 136 | } else { |
| 88 | const response = await axios.postForm(url(`maps/${map_id}/record`), { | 137 | const response = await axios.postForm( |
| 89 | "host_demo": run.host_demo, | 138 | url(`maps/${map_id}/record`), |
| 90 | }, { | 139 | { |
| 91 | headers: { | 140 | host_demo: run.host_demo, |
| 92 | "Authorization": token, | 141 | }, |
| 142 | { | ||
| 143 | headers: { | ||
| 144 | Authorization: token, | ||
| 145 | }, | ||
| 93 | } | 146 | } |
| 94 | }); | 147 | ); |
| 95 | return [response.data.success, response.data.message]; | 148 | return [response.data.success, response.data.message]; |
| 96 | } | 149 | } |
| 97 | } | 150 | }; |
| 98 | 151 | ||
| 99 | export const delete_map_record = async (token: string, map_id: number, record_id: number): Promise<boolean> => { | 152 | export const delete_map_record = async ( |
| 100 | const response = await axios.delete(url(`maps/${map_id}/record/${record_id}`), { | 153 | token: string, |
| 101 | headers: { | 154 | map_id: number, |
| 102 | "Authorization": token, | 155 | record_id: number |
| 156 | ): Promise<boolean> => { | ||
| 157 | const response = await axios.delete( | ||
| 158 | url(`maps/${map_id}/record/${record_id}`), | ||
| 159 | { | ||
| 160 | headers: { | ||
| 161 | Authorization: token, | ||
| 162 | }, | ||
| 103 | } | 163 | } |
| 104 | }); | 164 | ); |
| 105 | return response.data.success; | 165 | return response.data.success; |
| 106 | }; | 166 | }; |
diff --git a/frontend/src/api/Mod.ts b/frontend/src/api/Mod.ts index 1511f8b..69e76c5 100644 --- a/frontend/src/api/Mod.ts +++ b/frontend/src/api/Mod.ts | |||
| @@ -1,58 +1,86 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from 'axios'; |
| 2 | import { url } from "@api/Api"; | 2 | import { url } from '@api/Api'; |
| 3 | import { ModMenuContent } from "@customTypes/Content"; | 3 | import { ModMenuContent } from '@customTypes/Content'; |
| 4 | 4 | ||
| 5 | export const put_map_image = async (token: string, map_id: string, image: string): Promise<boolean> => { | 5 | export const put_map_image = async ( |
| 6 | const response = await axios.put(url(`maps/${map_id}/image`), { | 6 | token: string, |
| 7 | "image": image, | 7 | map_id: string, |
| 8 | }, { | 8 | image: string |
| 9 | headers: { | 9 | ): Promise<boolean> => { |
| 10 | "Authorization": token, | 10 | const response = await axios.put( |
| 11 | url(`maps/${map_id}/image`), | ||
| 12 | { | ||
| 13 | image: image, | ||
| 14 | }, | ||
| 15 | { | ||
| 16 | headers: { | ||
| 17 | Authorization: token, | ||
| 18 | }, | ||
| 11 | } | 19 | } |
| 12 | }); | 20 | ); |
| 13 | return response.data.success; | 21 | return response.data.success; |
| 14 | }; | 22 | }; |
| 15 | 23 | ||
| 16 | export const post_map_summary = async (token: string, map_id: string, content: ModMenuContent): Promise<boolean> => { | 24 | export const post_map_summary = async ( |
| 17 | const response = await axios.post(url(`maps/${map_id}/summary`), { | 25 | token: string, |
| 18 | "category_id": content.category_id, | 26 | map_id: string, |
| 19 | "user_name": content.name, | 27 | content: ModMenuContent |
| 20 | "score_count": content.score, | 28 | ): Promise<boolean> => { |
| 21 | "record_date": content.date, | 29 | const response = await axios.post( |
| 22 | "showcase": content.showcase, | 30 | url(`maps/${map_id}/summary`), |
| 23 | "description": content.description, | 31 | { |
| 24 | }, { | 32 | category_id: content.category_id, |
| 25 | headers: { | 33 | user_name: content.name, |
| 26 | "Authorization": token, | 34 | score_count: content.score, |
| 35 | record_date: content.date, | ||
| 36 | showcase: content.showcase, | ||
| 37 | description: content.description, | ||
| 38 | }, | ||
| 39 | { | ||
| 40 | headers: { | ||
| 41 | Authorization: token, | ||
| 42 | }, | ||
| 27 | } | 43 | } |
| 28 | }); | 44 | ); |
| 29 | return response.data.success; | 45 | return response.data.success; |
| 30 | }; | 46 | }; |
| 31 | 47 | ||
| 32 | export const put_map_summary = async (token: string, map_id: string, content: ModMenuContent): Promise<boolean> => { | 48 | export const put_map_summary = async ( |
| 33 | const response = await axios.put(url(`maps/${map_id}/summary`), { | 49 | token: string, |
| 34 | "route_id": content.id, | 50 | map_id: string, |
| 35 | "user_name": content.name, | 51 | content: ModMenuContent |
| 36 | "score_count": content.score, | 52 | ): Promise<boolean> => { |
| 37 | "record_date": content.date, | 53 | const response = await axios.put( |
| 38 | "showcase": content.showcase, | 54 | url(`maps/${map_id}/summary`), |
| 39 | "description": content.description, | 55 | { |
| 40 | }, { | 56 | route_id: content.id, |
| 41 | headers: { | 57 | user_name: content.name, |
| 42 | "Authorization": token, | 58 | score_count: content.score, |
| 59 | record_date: content.date, | ||
| 60 | showcase: content.showcase, | ||
| 61 | description: content.description, | ||
| 62 | }, | ||
| 63 | { | ||
| 64 | headers: { | ||
| 65 | Authorization: token, | ||
| 66 | }, | ||
| 43 | } | 67 | } |
| 44 | }); | 68 | ); |
| 45 | return response.data.success; | 69 | return response.data.success; |
| 46 | }; | 70 | }; |
| 47 | 71 | ||
| 48 | export const delete_map_summary = async (token: string, map_id: string, route_id: number): Promise<boolean> => { | 72 | export const delete_map_summary = async ( |
| 73 | token: string, | ||
| 74 | map_id: string, | ||
| 75 | route_id: number | ||
| 76 | ): Promise<boolean> => { | ||
| 49 | const response = await axios.delete(url(`maps/${map_id}/summary`), { | 77 | const response = await axios.delete(url(`maps/${map_id}/summary`), { |
| 50 | data: { | 78 | data: { |
| 51 | "route_id": route_id, | 79 | route_id: route_id, |
| 52 | }, | 80 | }, |
| 53 | headers: { | 81 | headers: { |
| 54 | "Authorization": token, | 82 | Authorization: token, |
| 55 | } | 83 | }, |
| 56 | }); | 84 | }); |
| 57 | return response.data.success; | 85 | return response.data.success; |
| 58 | }; | 86 | }; |
diff --git a/frontend/src/api/Rankings.ts b/frontend/src/api/Rankings.ts index b8d9bec..9afd999 100644 --- a/frontend/src/api/Rankings.ts +++ b/frontend/src/api/Rankings.ts | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from 'axios'; |
| 2 | import { url } from "@api/Api"; | 2 | import { url } from '@api/Api'; |
| 3 | import { Ranking, SteamRanking } from "@customTypes/Ranking"; | 3 | import { Ranking, SteamRanking } from '@customTypes/Ranking'; |
| 4 | 4 | ||
| 5 | export const get_official_rankings = async (): Promise<Ranking> => { | 5 | export const get_official_rankings = async (): Promise<Ranking> => { |
| 6 | const response = await axios.get(url(`rankings/lphub`)); | 6 | const response = await axios.get(url(`rankings/lphub`)); |
diff --git a/frontend/src/api/User.ts b/frontend/src/api/User.ts index 004aa22..4ce21e1 100644 --- a/frontend/src/api/User.ts +++ b/frontend/src/api/User.ts | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from 'axios'; |
| 2 | import { url } from "@api/Api"; | 2 | import { url } from '@api/Api'; |
| 3 | import { UserProfile } from "@customTypes/Profile"; | 3 | import { UserProfile } from '@customTypes/Profile'; |
| 4 | 4 | ||
| 5 | export const get_user = async (user_id: string): Promise<UserProfile> => { | 5 | export const get_user = async (user_id: string): Promise<UserProfile> => { |
| 6 | const response = await axios.get(url(`users/${user_id}`)); | 6 | const response = await axios.get(url(`users/${user_id}`)); |