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;
|
||||
});
|
||||
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
|
||||
|
||||
@@ -189,12 +189,7 @@ export default function UserProfile() {
|
||||
Modifiez les champs en les selectionnants
|
||||
</Text>
|
||||
|
||||
<Box
|
||||
position={"relative"}
|
||||
as="form"
|
||||
onSubmit={handleSubmit(saveData)}
|
||||
width={"80%"}
|
||||
>
|
||||
<Box as="form" onSubmit={handleSubmit(saveData)} width={"80%"}>
|
||||
<Flex width={"100%"} justify={"space-between"} mb={"1rem"}>
|
||||
<Box>
|
||||
<CustomEditable
|
||||
@@ -347,7 +342,7 @@ export default function UserProfile() {
|
||||
/>
|
||||
</Box>
|
||||
<Divider colorScheme={"purple"} />
|
||||
<Center position={"sticky"} bottom={0} gap={"1rem"} my={"1rem"}>
|
||||
<Center gap={"1rem"} my={"1rem"}>
|
||||
<Button
|
||||
colorScheme={"purple"}
|
||||
isLoading={currentlyLoading}
|
||||
|
||||
Reference in New Issue
Block a user