From ca8b2e512164b9732862927962ba6fb9dca57dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne=20L=27H=C3=B4te?= Date: Fri, 17 Nov 2023 09:09:05 +0100 Subject: [PATCH] refactor(ui): Clean code --- client/src/layout/index.jsx | 5 +++-- client/src/utils/works.js | 20 -------------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/client/src/layout/index.jsx b/client/src/layout/index.jsx index fcd30d49..268eb3d2 100644 --- a/client/src/layout/index.jsx +++ b/client/src/layout/index.jsx @@ -1,8 +1,9 @@ +import { Container, SwitchTheme } from '@dataesr/react-dsfr'; import { useState } from 'react'; import { Outlet } from 'react-router-dom'; -import { Container, SwitchTheme } from '@dataesr/react-dsfr'; -import Header from './Header'; + import Footer from './Footer'; +import Header from './Header'; export default function Layout() { const [isSwitchThemeOpen, setIsSwitchThemeOpen] = useState(false); diff --git a/client/src/utils/works.js b/client/src/utils/works.js index 18f1f9fb..5031a1c5 100644 --- a/client/src/utils/works.js +++ b/client/src/utils/works.js @@ -2,24 +2,6 @@ const { VITE_API, } = import.meta.env; -const getBsoCount = (options) => { - const urlParams = new URLSearchParams(options).toString(); - return fetch(`${VITE_API}/bso/count?${urlParams}`) - .then((response) => { - if (response.ok) return response.json(); - return 'Oops... BSO API request did not work'; - }); -}; - -const getBsoWorks = async ({ options, index }) => { - const urlParams = new URLSearchParams({ ...options, index }).toString(); - return fetch(`${VITE_API}/bso/works?${urlParams}`) - .then((response) => { - if (response.ok) return response.json(); - return 'Oops... BSO API request did not work'; - }); -}; - const getData = async (options) => { const urlParams = new URLSearchParams(options).toString(); return fetch(`${VITE_API}/works?${urlParams}`) @@ -55,8 +37,6 @@ const getIdLink = (type, id) => { }; export { - getBsoCount, - getBsoWorks, getData, getIdLink, };