Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F44414384
serviceModel.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
501 B
Referenced Files
None
Subscribers
None
serviceModel.js
View Options
// serviceModel.js
const
pool
=
require
(
'../config/database.js'
);
const
addService
=
async
(
data
)
=>
{
return
await
pool
.
query
(
'INSERT INTO service (name, "group", description, status) VALUES (\$1, \$2, \$3, \$4) RETURNING *'
,
[
data
.
name
,
data
.
group
,
data
.
description
,
data
.
status
]);
};
const
getServices
=
async
()
=>
{
return
await
pool
.
query
(
'SELECT * FROM service;'
);
};
// ... other CRUD methods for service table
module
.
exports
=
{
addService
,
getServices
,
/* ... other CRUD methods */
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 18, 23:08 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3918849
Default Alt Text
serviceModel.js (501 B)
Attached To
Mode
rSP ServPulse
Attached
Detach File
Event Timeline
Log In to Comment