Skip to content

Commit

Permalink
refactor(ui): Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Nov 17, 2023
1 parent 3a71428 commit ca8b2e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
5 changes: 3 additions & 2 deletions client/src/layout/index.jsx
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
20 changes: 0 additions & 20 deletions client/src/utils/works.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down Expand Up @@ -55,8 +37,6 @@ const getIdLink = (type, id) => {
};

export {
getBsoCount,
getBsoWorks,
getData,
getIdLink,
};

0 comments on commit ca8b2e5

Please sign in to comment.