first commit
This commit is contained in:
25
config/service.js
Normal file
25
config/service.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const {initPool} = require("./db") ;
|
||||
|
||||
class ServiceHanlderClass {
|
||||
async getData(){
|
||||
|
||||
const pool = await initPool();
|
||||
try {
|
||||
|
||||
const result = await pool.request().query("EXEC TDP.dbo.SP_ListFullPatientStatus01 ");
|
||||
|
||||
// await pool.close();
|
||||
// pool=null;
|
||||
// console.log('closed')
|
||||
return result;
|
||||
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
throw new Error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const ServiceHandler = new ServiceHanlderClass();
|
||||
|
||||
module.exports = ServiceHandler;
|
||||
Reference in New Issue
Block a user