mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-05-13 17:21:53 +00:00
fix(Api sending error when no user found): Api sending error when no user found
This commit is contained in:
@@ -58,9 +58,9 @@ const get = async (req, res) => {
|
|||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
if (users.length === 0 || users === undefined || users === null) {
|
if (users.length === 0 || users === undefined || users === null) {
|
||||||
return res.status(500).send({ error: "Aucun profil trouvé" });
|
return res.status(200).send({ users: [], message: "Aucun profil trouvé" });
|
||||||
}
|
}
|
||||||
return res.status(200).send({ users });
|
return res.status(200).send({ users: users, message: "Profil(s) trouvé(s)" });
|
||||||
};
|
};
|
||||||
|
|
||||||
// faire une API pour ajouter un like / dislike
|
// faire une API pour ajouter un like / dislike
|
||||||
|
|||||||
@@ -189,12 +189,7 @@ export default function UserProfile() {
|
|||||||
Modifiez les champs en les selectionnants
|
Modifiez les champs en les selectionnants
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Box
|
<Box as="form" onSubmit={handleSubmit(saveData)} width={"80%"}>
|
||||||
position={"relative"}
|
|
||||||
as="form"
|
|
||||||
onSubmit={handleSubmit(saveData)}
|
|
||||||
width={"80%"}
|
|
||||||
>
|
|
||||||
<Flex width={"100%"} justify={"space-between"} mb={"1rem"}>
|
<Flex width={"100%"} justify={"space-between"} mb={"1rem"}>
|
||||||
<Box>
|
<Box>
|
||||||
<CustomEditable
|
<CustomEditable
|
||||||
@@ -347,7 +342,7 @@ export default function UserProfile() {
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
<Divider colorScheme={"purple"} />
|
<Divider colorScheme={"purple"} />
|
||||||
<Center position={"sticky"} bottom={0} gap={"1rem"} my={"1rem"}>
|
<Center gap={"1rem"} my={"1rem"}>
|
||||||
<Button
|
<Button
|
||||||
colorScheme={"purple"}
|
colorScheme={"purple"}
|
||||||
isLoading={currentlyLoading}
|
isLoading={currentlyLoading}
|
||||||
|
|||||||
Reference in New Issue
Block a user