How to fix ReferenceError: insertState is not define
Ksoftcode opened this issue · comments
Hi Dumbape, I'm trying to gain access to the Login Page but it gives giving me this error upon the loading of the main.js file. I have done the necessary configuration in the db_controller file.
Error message.....
Communications@DESKTOP-RHC1CHH MINGW64 /c/xampp/htdocs/HIMS
$ node main.js
C:\xampp\htdocs\HIMS\controllers\db_controller.js:85
insertState('Ilorin', 'Kwara', function(interState){
^
ReferenceError: insertState is not defined
at module.exports (C:\xampp\htdocs\HIMS\controllers\db_controller.js:85:2)
at Object. (C:\xampp\htdocs\HIMS\main.js:67:1)
at Module._compile (internal/modules/cjs/loader.js:1157:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
at Module.load (internal/modules/cjs/loader.js:1001:32)
at Function.Module._load (internal/modules/cjs/loader.js:900:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js
:74:12)
at internal/main/run_main_module.js:18:47
code......
module.exports = function(resetSystem){
// delete data from all tables
// clearTable('city_state');
// clearTable('complain');
// clearTable('curr');
// clearTable('doctor');
// clearTable('employee');
// clearTable('employee_contact');
// clearTable('employee_email');
// clearTable('hardware');
// clearTable('login');
// clearTable('nurse');
// clearTable('patient');
// clearTable('record');
// clearTable('room');
// clearTable('server');
// addServer();
insertState('Bangalore', 'Karnataka', function(){
insertEmployee(1000,'Admin','male',0.00,'Manager',1234567890,adminDetails.emailId,'Somewhere on Earth','Bangalore', function(){
const pass = adminDetails.password;
bcrypt.hash(pass, 10, function (err, hash) {
insertLogin(1000, hash);
});
});
})
}