Feat/um 197 hook up teams (#1825)

* Link up teams UI.

* Fix auth order.

* PR touchups.
This commit is contained in:
Brian Cao 2023-03-09 12:42:12 -08:00 committed by GitHub
parent f908476e71
commit 8a9532f213
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 500 additions and 111 deletions

View file

@ -6,13 +6,13 @@ import { methodNotAllowed, ok, notFound } from 'next-basics';
import { createTeamUser, getTeam } from 'queries';
import { ROLES } from 'lib/constants';
export interface TeamsRequestBody {
export interface TeamsJoinRequestBody {
accessCode: string;
}
export default async (
req: NextApiRequestQueryBody<any, TeamsRequestBody>,
res: NextApiResponse<Team[] | Team>,
req: NextApiRequestQueryBody<any, TeamsJoinRequestBody>,
res: NextApiResponse<Team>,
) => {
await useAuth(req, res);