Tailwind config and basic services
This commit is contained in:
parent
f1e90c4dd2
commit
be6467cd2c
41 changed files with 581 additions and 102 deletions
26
src/api/user/user.ts
Normal file
26
src/api/user/user.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { callApi, HTTP } from "../tools";
|
||||
import {
|
||||
IFetchLoggedUserResponse,
|
||||
IFetchUserRequest,
|
||||
IFetchUserResponse,
|
||||
IFetchUserCommunitiesRequest,
|
||||
IFetchUserCommunitiesResponse,
|
||||
} from "./types";
|
||||
|
||||
const fetchLoggedUserApi = async (): Promise<IFetchLoggedUserResponse> => {
|
||||
return await callApi(HTTP.GET, `user/logged`);
|
||||
};
|
||||
|
||||
const fetchUserApi = async (
|
||||
request: IFetchUserRequest,
|
||||
): Promise<IFetchUserResponse> => {
|
||||
return await callApi(HTTP.GET, `user/${request.id}`);
|
||||
};
|
||||
|
||||
const fetchUserCommunitiesApi = async (
|
||||
request: IFetchUserCommunitiesRequest,
|
||||
): Promise<IFetchUserCommunitiesResponse> => {
|
||||
return await callApi(HTTP.GET, `user/${request.id}/communities`);
|
||||
};
|
||||
|
||||
export { fetchLoggedUserApi, fetchUserApi, fetchUserCommunitiesApi };
|
||||
Loading…
Add table
Add a link
Reference in a new issue