While Registring as an admin, the data is saved in collection User intead of collection Admin because the in signup post request we are creating the new User intead of new Admin.
file: server/routes/admin.js //line no. 27
previous code: const newUser = new User({ username, password });
New Code : const newUser = new Admin({ username, password });
While Registring as an admin, the data is saved in collection User intead of collection Admin because the in signup post request we are creating the new User intead of new Admin.
file: server/routes/admin.js //line no. 27
previous code: const newUser = new User({ username, password });
New Code : const newUser = new Admin({ username, password });