File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,20 @@ async def mostrar_todas_as_agendas_que_o_usuário_faz_parte(uid_do_responsavel:
289289
290290 return agendas
291291
292+ @app .get ("/getAllTarefasFromOneAgenda" , tags = ["Agenda" ], responses = STANDARD_RESPONSES )
293+ async def get_all_tarefas_from_agenda (uid_da_agenda : str , api_key : str = Depends (get_api_key )):
294+ agenda_node = agenda_ref .child (uid_da_agenda ).get ()
295+
296+ if not agenda_node :
297+ raise HTTPException (status_code = 404 , detail = f"A agenda com UID '{ uid_da_agenda } ' não existe." )
298+
299+ tarefas = agenda_node .get ("tarefas" )
300+
301+ if not tarefas :
302+ raise HTTPException (status_code = 404 , detail = f"A agenda '{ uid_da_agenda } ' não possui tarefas." )
303+
304+ return {"tarefas" : tarefas }
305+
292306@app .post ("/add/agenda" , tags = ["Agenda" ], responses = STANDARD_RESPONSES )
293307async def criar_uma_agenda (nome_agenda : str , uid_do_responsavel : str , api_key : str = Depends (get_api_key )):
294308 if not check_uid_exists (uid_do_responsavel ):
You can’t perform that action at this time.
0 commit comments