mirror of
https://github.com/hex248/sprint.git
synced 2026-02-07 18:23:03 +00:00
select first organisation and first project by default
This commit is contained in:
@@ -32,6 +32,7 @@ function Index() {
|
||||
.then((res) => res.json())
|
||||
.then((data: Array<OrganisationResponse>) => {
|
||||
setOrganisations(data);
|
||||
setSelectedOrganisation(data[0] || null);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("error fetching organisations:", err);
|
||||
@@ -78,6 +79,12 @@ function Index() {
|
||||
});
|
||||
}, [selectedProject]);
|
||||
|
||||
useEffect(() => {
|
||||
if (projects.length > 0) {
|
||||
setSelectedProject(projects[0]);
|
||||
}
|
||||
}, [projects]);
|
||||
|
||||
return (
|
||||
<main className="w-full h-full p-1">
|
||||
{/* header area */}
|
||||
|
||||
Reference in New Issue
Block a user