diff --git a/src/api/ResponseProps.ts b/src/api/ResponseProps.ts new file mode 100644 index 0000000000000000000000000000000000000000..45803095ebb029f8bef2c9e8b9da3f5b1fd24c9a --- /dev/null +++ b/src/api/ResponseProps.ts @@ -0,0 +1,9 @@ +export type ResponseProps = { + id: number; + user: { + email: string; + firstName: string; + lastName: string; + username: string; + }; +}; diff --git a/src/api/getSeniorList.ts b/src/api/getSeniorList.ts index d300c33e90ef584b234b5521d052a7a5797260f6..239e48e6598e73d60181c44a050ed4f87fa03a45 100644 --- a/src/api/getSeniorList.ts +++ b/src/api/getSeniorList.ts @@ -1,4 +1,7 @@ import axios from 'axios'; +import { ResponseProps } from './ResponseProps'; -export const getSeniorList = async (name: string): Promise<string[]> => - axios.get(`/api/web/seniors/by_name/${name}`).then((res) => res.data); +export const getSeniorList = async (name: string): Promise<ResponseProps[]> => + axios + .get(`/api/web/seniors/by_name/${name}?fields=user,id`) + .then((res) => res.data);