Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete: route current revision moissonneur #75

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions lib/api-moissonneur-bal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,6 @@ export async function getSourceHarvests(
return result.json();
}

export async function getSourceCurrentRevisions(
id: string
): Promise<RevisionMoissoneurType[]> {
const result = await fetch(
`${NEXT_PUBLIC_API_MOISSONEUR_BAL}/sources/${id}/current-revisions`
);

if (!result.ok) {
const error = await result.json();
throw new Error(error.message);
}

return result.json();
}

export async function getSourceLastUpdatedRevisions(
id: string
): Promise<AggregateRevisionMoissoneurType[]> {
Expand Down
11 changes: 8 additions & 3 deletions pages/moissonneur-bal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
router.push(`/moissonneur-bal?page=${selectedTabId}`, undefined, {
shallow: true,
});
}, [selectedTabId]);

Check warning on line 34 in pages/moissonneur-bal.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

React Hook useEffect has a missing dependency: 'router'. Either include it or remove the dependency array

Check warning on line 34 in pages/moissonneur-bal.tsx

View workflow job for this annotation

GitHub Actions / build (20.x)

React Hook useEffect has a missing dependency: 'router'. Either include it or remove the dependency array

return (
<div className="fr-container">
Expand All @@ -40,17 +40,17 @@
selectedTabId={selectedTabId}
onTabChange={(e) => setSelectedTabId(e)}
tabs={[
{ tabId: "sources", label: "Sources" },
{ tabId: "organizations", label: "Organisations" },
{ tabId: "sources", label: "Sources" },
]}
>
{selectedTabId === "sources" && <MoissoneurSources sources={sources} />}
{selectedTabId === "organizations" && (
<MoissoneurOrganizations
organizations={organizations}
partenaires={partenaires}
/>
)}
{selectedTabId === "sources" && <MoissoneurSources sources={sources} />}
</Tabs>
</div>
);
Expand All @@ -64,7 +64,12 @@
await getPartenairesDeLaCharte();

return {
props: { sources, organizations, partenaires, page: page || "sources" },
props: {
sources,
organizations,
partenaires,
page: page || "organizations",
},
};
}

Expand Down
Loading