refactor(Dashboard api): changed api to fetch potential match

api now asks only the userID and fetches everything itself
This commit is contained in:
Laurian-Dufrechou
2023-05-02 22:30:08 +02:00
parent e4d89a0fa1
commit edcf469c29
4 changed files with 40 additions and 37 deletions
+1 -10
View File
@@ -58,16 +58,7 @@ export default function Dashboard() {
queryKey: ["ListUsers"],
enabled: status === "authenticated" && !isLoading,
queryFn: async () => {
return fetch(
`/api/user/userDashboard?preferences=${[
loggedUser.prefGender,
loggedUser.ageMin,
loggedUser.ageMax,
loggedUser.distance,
]}&excludedId=${loggedUser.id}&userLikes=${
loggedUser.UserLikesID
}&userDislikes=${loggedUser.UserDislikesID}`
) //exclure les profils déjà like ou dislike
return fetch(`/api/user/userDashboard?userID=${loggedUser.id}`) //exclure les profils déjà like ou dislike
.then((res) => res.json())
.catch((err) => {
return err;