Skip to content

Commit

Permalink
#144 - Alteração no retorno de aceitar notificação
Browse files Browse the repository at this point in the history
  • Loading branch information
Reginaldo-Neto committed Jun 18, 2023
1 parent d3ee322 commit 0c1b77f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/api/routers/teams_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from api.schemas.teams_has_users import UserWithTeams
from fastapi.encoders import jsonable_encoder
from api.websocket.connection_manager import ws_manager
from api.schemas.teams import RemoveUserFromTeamReturn

router = APIRouter(
prefix="/teams",
Expand Down Expand Up @@ -184,7 +185,7 @@ async def addUserToTeam(input: AcceptTeamInviteInput, token: Annotated[str, Depe
session.refresh(notification)
session.refresh(data)

return data
return notification


@router.post(
Expand Down Expand Up @@ -233,7 +234,7 @@ async def inviteUserToTeam(input: AddUserToTeamInput, token: Annotated[str, Depe
@router.post(
"/remove-user",
status_code=200,
response_model=AddUserToTeamReturn,
response_model=RemoveUserFromTeamReturn,
response_description="Sucesso de resposta da aplicação.",
)
async def addUserToTeam(input: AddUserToTeamInput, token: Annotated[str, Depends(oauth2_scheme)]):
Expand Down
7 changes: 7 additions & 0 deletions backend/api/schemas/teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,14 @@ class AddUserToTeamReturn(BaseModel):
class Config:
orm_mode = True

class RemoveUserFromTeamReturn(BaseModel):
team_id: int
user_id: int

class Config:
orm_mode = True


class Response(GenericModel, Generic[T]):
code: str
status: str
Expand Down

0 comments on commit 0c1b77f

Please sign in to comment.