feat: quitar límite de 3 tareas sin responsable y ordenar fichas

Co-authored-by: aider (openrouter/openai/gpt-5) <aider@aider.chat>
webui
borja 2 weeks ago
parent 863a700d5a
commit 9debaf93c9

@ -44,7 +44,7 @@
{#if previews?.length}
<div class="previews">
<em class="title">Sin responsable (hasta 3):</em>
<em class="title">Sin responsable:</em>
<ul class="list">
{#each previews as t}
<li class="row">

@ -8,15 +8,16 @@ export const load: PageServerLoad = async (event) => {
}
const data = await res.json();
const groups = Array.isArray(data?.items) ? data.items : [];
// Ordenar fichas por cantidad de tareas sin responsable (desc)
groups.sort((a: any, b: any) => Number(b?.counts?.unassigned || 0) - Number(a?.counts?.unassigned || 0));
// Prefetch de "sin responsable" por grupo (ligero)
const previews: Record<string, any[]> = {};
const previewLimit = 3;
for (const g of groups) {
try {
const r = await event.fetch(
`/api/groups/${encodeURIComponent(g.id)}/tasks?unassignedFirst=true&onlyUnassigned=true&limit=${previewLimit}`,
`/api/groups/${encodeURIComponent(g.id)}/tasks?unassignedFirst=true&onlyUnassigned=true`,
{ headers: { 'cache-control': 'no-store' } }
);
if (r.ok) {

Loading…
Cancel
Save