-
Notifications
You must be signed in to change notification settings - Fork 0
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
Hel 509/search history #349
Conversation
src/pages/history.tsx
Outdated
import { SearchHistoryPage } from "../frontend/ui/search-history/SearchHistoryPage"; | ||
|
||
export default function Favoris() { | ||
useBreadcrumb([]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add breadcrumb
src/pages/favoris.tsx
Outdated
import { FavorisPage } from "../frontend/ui/favoris/FavorisPage"; | ||
|
||
export default function Favoris() { | ||
useBreadcrumb([]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add breadcrumb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file name "add"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filename "get"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filename "remove"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filename "get"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filename "add"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il manque peut etre la réponse 500 s'il y a une erreur quelque part avec un try catch
}) | ||
.then((response) => response.json()) | ||
.then((data) => { | ||
var formattedHistory: SearchHistoryView[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utiliser let à la place de var
.then((response) => response.json()) | ||
.then((data) => { | ||
var formattedHistory: SearchHistoryView[] = []; | ||
data.map((elt: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data.map retourne un tableau, tu peut utiliser ce tableau et le set dans setSearchHistory
const formattedHistory = data.map(elt => ({ title: ..., date: ..., finessNumber: ..., type: ... });
|
||
|
||
const handleFavoriteStatus = async () => { | ||
const filtredFavoris = userContext?.favoris.filter((item) => item.numéroFiness === favorite?.numéroFiness); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
table favoris only one call
}) | ||
.then((response) => response.json()) | ||
.then((data) => { | ||
var favorisViewModel: RechercheViewModel[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
traitement avec map
import styles from "./Recherche.module.css"; | ||
|
||
type EstablishmentProps = Readonly<{ | ||
résultatViewModel: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace by recherche view model
src/pages/api/auth/[...nextauth].ts
Outdated
@@ -47,6 +48,8 @@ export default NextAuth({ | |||
return token | |||
}, | |||
async session({ session, token }) { | |||
session.user.idUser = token['idUser'] as string; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove space
if (request.method !== "POST") { | ||
return response.status(405).send("Method not allowed"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add try catch with 500 response in catch
if (request.method !== "GET") { | ||
response.status(405).send("Method not allowed"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add try catch with 500 response in catch
if (request.method !== "POST") { | ||
response.status(405).send("Method not allowed"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add try catch with 500 response in catch
if (request.method !== "POST") { | ||
return response.status(405).send("Method not allowed"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add try catch with 500 response in catch
if (request.method !== "GET") { | ||
response.status(405).send("Method not allowed"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add try catch with 500 response in catch
@@ -18,16 +22,35 @@ type RouterProps = Readonly<{ | |||
export default function Router({ entitéJuridique, établissementsTerritoriauxRattachés }: RouterProps) { | |||
const { wording } = useDependencies(); | |||
|
|||
const { rechercher, résultats } = useRecherche(); | |||
const [rechercheViewModel, setRechercheViewModel] = useState<RechercheViewModel>(); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get data in getStaticProps function
Vérifier avant de merger
data_set
?middleware.ts
etlighthouserc.js
dû à la création/suppression d'une page ?Content-Security-Policy
dansnext.config.js
?