Skip to content

Commit d7472b0

Browse files
committed
fix: ca controller bug
1 parent e3a1eb6 commit d7472b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/ca.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ export const updateRequest = async (req, res, next) => {
5858
);
5959
}
6060
if (status) {
61-
request.status = status;
6261
if (req.user.role === "admin" && status === "approved") {
6362
await User.findByIdAndUpdate(request.user, { role: "ca" });
6463
}
6564

6665
if (req.user.role === "admin" && status !== "approved" && request.status === "approved") {
6766
await User.findByIdAndUpdate(request.user, { role: "user" });
6867
}
68+
request.status = status;
6969
}
7070

7171
if (req.user.role !== "admin") {

0 commit comments

Comments
 (0)