diff --git a/website/components/FunctionCard/FunctionCard.jsx b/website/components/FunctionCard/FunctionCard.jsx index 1f409c7..42565b9 100644 --- a/website/components/FunctionCard/FunctionCard.jsx +++ b/website/components/FunctionCard/FunctionCard.jsx @@ -2,7 +2,7 @@ import Link from 'next/link' import { useState, forwardRef, memo } from 'react' import date from 'date-and-time' import Loader from '../Loader' -import { API_URL } from '../../utils/config/config' +import { API_URL } from '../../utils/api' import './FunctionCard.css' const FunctionCard = memo( diff --git a/website/components/FunctionPage/CommentCard/CommentCard.jsx b/website/components/FunctionPage/CommentCard/CommentCard.jsx index 1faf419..fc18dc6 100644 --- a/website/components/FunctionPage/CommentCard/CommentCard.jsx +++ b/website/components/FunctionPage/CommentCard/CommentCard.jsx @@ -3,10 +3,9 @@ import { useEffect, useState, forwardRef, useContext } from 'react' import date from 'date-and-time' import htmlParser from 'html-react-parser' import { UserContext } from '../../../contexts/UserContext' -import { API_URL } from '../../../utils/config/config' import ReactMarkdown from 'react-markdown' import CodeBlock from '../../CodeBlock' -import api from '../../../utils/api' +import api, { API_URL } from '../../../utils/api' import './CommentCard.css' const CommentCard = forwardRef((props, ref) => { diff --git a/website/components/FunctionPage/FunctionComponentTop.jsx b/website/components/FunctionPage/FunctionComponentTop.jsx index cedc34c..0f8b55a 100644 --- a/website/components/FunctionPage/FunctionComponentTop.jsx +++ b/website/components/FunctionPage/FunctionComponentTop.jsx @@ -5,8 +5,7 @@ import { faStar } from '@fortawesome/free-solid-svg-icons' import { faStar as farStar } from '@fortawesome/free-regular-svg-icons' import date from 'date-and-time' import { UserContext } from '../../contexts/UserContext' -import api from '../../utils/api' -import { API_URL } from '../../utils/config/config' +import api, { API_URL } from '../../utils/api' import '../FunctionCard/FunctionCard.css' const FunctionComponentTop = props => { diff --git a/website/components/FunctionPage/FunctionPage.jsx b/website/components/FunctionPage/FunctionPage.jsx index 3b71a36..3c38343 100644 --- a/website/components/FunctionPage/FunctionPage.jsx +++ b/website/components/FunctionPage/FunctionPage.jsx @@ -1,5 +1,5 @@ import { useState } from 'react' -import { API_URL } from '../../utils/config/config' +import { API_URL } from '../../utils/api' import HeadTag from '../HeadTag' import FunctionTabsTop from './FunctionTabsTop' import FunctionComponentTop from './FunctionComponentTop' diff --git a/website/components/UserCard/UserCard.jsx b/website/components/UserCard/UserCard.jsx index 22fae0e..767306f 100644 --- a/website/components/UserCard/UserCard.jsx +++ b/website/components/UserCard/UserCard.jsx @@ -1,6 +1,6 @@ import Link from 'next/link' import { forwardRef, memo } from 'react' -import { API_URL } from '../../utils/config/config' +import { API_URL } from '../../utils/api' import './UserCard.css' const UserCard = memo( diff --git a/website/pages/404.jsx b/website/pages/404.jsx index d23a327..4d72f67 100644 --- a/website/pages/404.jsx +++ b/website/pages/404.jsx @@ -10,9 +10,14 @@ const Error404 = () => ( image='/images/error404.png' />
- Cette page n'existe pas! Revenir à la page d'accueil ? + Cette page n'existe pas!{' '} + + Revenir à la page d'accueil ? +
Erreur: ${error.response.data.message}
`) + .catch(error => { + setMessage( + `Erreur: ${error.response.data.message}
` + ) setIsLoading(false) }) } @@ -51,10 +66,20 @@ const AddEditCategory = (props) => {id | -name | -color | -createdAt | -updatedAt | -Modifier | -Supprimer | + {isOpen ? ( +
---|
+ id + | ++ name + | ++ color + | ++ createdAt + | ++ updatedAt + | ++ Modifier + | ++ Supprimer + | +
---|---|---|---|---|---|---|
{category.id} | +{category.name} | +{category.color} | ++ {date.format( + new Date(category.createdAt), + 'DD/MM/YYYY à HH:mm', + true + )} + | ++ {date.format( + new Date(category.updatedAt), + 'DD/MM/YYYY à HH:mm', + true + )} + | +
+ handleEditCategory({
+ name: category.name,
+ color: category.color,
+ id: category.id
+ })}
+ >
+ |
+ handleRemoveCategory(category.id)}
+ >
+ |
{category.id} | -{category.name} | -{category.color} | -{date.format(new Date(category.createdAt), 'DD/MM/YYYY à HH:mm', true)} | -{date.format(new Date(category.updatedAt), 'DD/MM/YYYY à HH:mm', true)} | - handleEditCategory({ name: category.name, color: category.color, id: category.id })}>
- |
- handleRemoveCategory(category.id)}>
- |
-
Total de {quotesData.totalItems} citations.
++ Total de {quotesData.totalItems} citations. +