Use directus return types, fix project link nested type API response

This commit is contained in:
2024-12-28 21:01:25 -06:00
parent fe3d2aefbe
commit 55b491bd33
3 changed files with 74 additions and 34 deletions

View File

@@ -25,13 +25,18 @@ async function getURLs(
const urls = ["/technology"];
// Get all projects with the technology
const all_projects = await directus.request(readItems("project"));
if (all_projects != null) {
for (const project of all_projects) {
if (project.technologies?.some((t) => t.id === key))
urls.push(`/projects/${project.id}`);
}
}
const all_projects = await directus.request(readItems("project", {
fields: ["id", {
technologies: ["id"],
}],
}));
// if (all_projects != null) {
// for (const project of all_projects) {
// if (project.technologies?.some((t) => t.id === key))
// urls.push(`/projects/${project.id}`);
// }
// }
return urls;
}