Prettier formatting
This commit is contained in:
1 parent
3ace148dc9
commit
5f6e0631c6
1 file changed
+3
-4
@@ -130,6 +130,7 @@ const loginUser = async (req, res, next) => {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { email, password } = req.body;
|
const { email, password } = req.body;
|
||||||
|
|
||||||
// Check if user exists
|
// Check if user exists
|
||||||
const user = await req.db.getUserByEmail(email);
|
const user = await req.db.getUserByEmail(email);
|
||||||
|
|
||||||
@@ -157,7 +158,7 @@ const loginUser = async (req, res, next) => {
|
|||||||
data: { user: userWithoutPassword, token: token },
|
data: { user: userWithoutPassword, token: token },
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
next(handleError(error, SERVICE_NAME, "loginController"));
|
next(handleError(error, SERVICE_NAME, "loginUser"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -433,9 +434,7 @@ const deleteUser = async (req, res, next) => {
|
|||||||
const getAllUsers = async (req, res, next) => {
|
const getAllUsers = async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const allUsers = await req.db.getAllUsers(req, res);
|
const allUsers = await req.db.getAllUsers(req, res);
|
||||||
res
|
res.status(200).json({ success: true, msg: "Got all users", data: allUsers });
|
||||||
.status(200)
|
|
||||||
.json({ success: true, msg: "Got all users", data: allUsers });
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
next(handleError(error, SERVICE_NAME, "getAllUsersController"));
|
next(handleError(error, SERVICE_NAME, "getAllUsersController"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user