mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-12-05 17:30:50 +00:00
refactor(Dashboard api): changed api to fetch potential match
api now asks only the userID and fetches everything itself
This commit is contained in:
+1
-10
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user