Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | 520x 21x 21x 520x 21x 21x 520x 3x 2x 520x 1x 1x 520x 50x 50x | import { ApiEndpoint } from "shared/constants/apiEndpoints";
import {
GetGroupRequest,
GetGroupResponse,
PostCloseGroupRequest,
PostCloseGroupResponse,
PostCreateGroupResponse,
PostJoinGroupRequest,
PostJoinGroupResponse,
PostLeaveGroupResponse,
} from "shared/types/api/groups";
import { api } from "client/utils/api";
export const postCreateGroup = async (): Promise<PostCreateGroupResponse> => {
const response = await api.post<PostCreateGroupResponse>(ApiEndpoint.GROUP);
return response.data;
};
export const postJoinGroup = async (
groupRequest: PostJoinGroupRequest,
): Promise<PostJoinGroupResponse> => {
const response = await api.post<PostJoinGroupResponse, PostJoinGroupRequest>(
ApiEndpoint.JOIN_GROUP,
groupRequest,
);
return response.data;
};
export const postLeaveGroup = async (): Promise<PostLeaveGroupResponse> => {
const response = await api.post<PostLeaveGroupResponse>(
ApiEndpoint.LEAVE_GROUP,
);
return response.data;
};
export const postCloseGroup = async (
groupRequest: PostCloseGroupRequest,
): Promise<PostCloseGroupResponse> => {
const response = await api.post<
PostCloseGroupResponse,
PostCloseGroupRequest
>(ApiEndpoint.CLOSE_GROUP, groupRequest);
return response.data;
};
export const getGroup = async (
groupCode: string,
): Promise<GetGroupResponse> => {
const response = await api.get<GetGroupResponse, GetGroupRequest>(
ApiEndpoint.GROUP,
{
params: {
groupCode,
},
},
);
return response.data;
};
|