We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9568f48 commit 253dfbbCopy full SHA for 253dfbb
1 file changed
src/services/reception.service.js
@@ -1,4 +1,19 @@
1
import User from '../models/User.js';
2
import bcrypt from 'bcrypt';
3
4
-const
+const creatReceptionist = async (data) => {
5
+ const password = data.password || 'reception@123';
6
+ const hashedPassword = await bcrypt.hash(password, 10);
7
+
8
+ const receptionist = new User({
9
+ ...data,
10
+ password: hashedPassword,
11
+ role: 'receptionist'
12
+ });
13
14
+ return await receptionist.save();
15
+};
16
17
+const changePassword = async (userId, oldPassword, newPassword) => {
18
+ const receptionist = await User.findById(userId)
19
+}
0 commit comments