Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Mike Cao 2024-02-02 17:49:30 -08:00
commit a91b9c9716
5 changed files with 22 additions and 8 deletions

View file

@ -37,6 +37,16 @@ export default async (
const { teamId, userId } = req.query;
if (req.method === 'GET') {
if (!(await canUpdateTeam(req.auth, teamId))) {
return unauthorized(res, 'You must be the owner of this team.');
}
const teamUser = await getTeamUser(teamId, userId);
return ok(res, teamUser);
}
if (req.method === 'POST') {
if (!(await canUpdateTeam(req.auth, teamId))) {
return unauthorized(res, 'You must be the owner of this team.');