Ajustes gerais - Etapa 1 #52
@@ -2697,7 +2697,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- Modal de Erro -->
|
<!-- Modal de Erro -->
|
||||||
<ErrorModal
|
<ErrorModal
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -90,14 +90,33 @@ export const listarTodas = query({
|
|||||||
.first();
|
.first();
|
||||||
|
|
||||||
let time = null;
|
let time = null;
|
||||||
|
let gestor = null;
|
||||||
if (membroTime) {
|
if (membroTime) {
|
||||||
time = await ctx.db.get(membroTime.timeId);
|
time = await ctx.db.get(membroTime.timeId);
|
||||||
|
// Buscar gestor do time
|
||||||
|
if (time?.gestorId) {
|
||||||
|
const gestorUsuario = await ctx.db.get(time.gestorId);
|
||||||
|
if (gestorUsuario) {
|
||||||
|
// Buscar funcionário do gestor para obter o nome
|
||||||
|
const gestorFuncionario = await ctx.db
|
||||||
|
.query("funcionarios")
|
||||||
|
.withIndex("by_usuario", (q) => q.eq("usuarioId", time.gestorId))
|
||||||
|
.first();
|
||||||
|
if (gestorFuncionario) {
|
||||||
|
gestor = {
|
||||||
|
_id: gestorUsuario._id,
|
||||||
|
nome: gestorFuncionario.nome,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...ferias,
|
...ferias,
|
||||||
funcionario,
|
funcionario,
|
||||||
time,
|
time,
|
||||||
|
gestor,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user