Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F18126561
incidentModel.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
552 B
Referenced Files
None
Subscribers
None
incidentModel.js
View Options
// incidentModel.js
const
pool
=
require
(
'../config/database.js'
);
const
createIncident
=
async
(
data
)
=>
{
return
await
pool
.
query
(
'INSERT INTO incident (title, start_date, update_date, type_id, status) VALUES (\$1, \$2, \$3, \$4, \$5) RETURNING *'
,
[
data
.
title
,
data
.
start_date
,
data
.
update_date
,
data
.
type_id
,
data
.
status
]);
};
const
getIncidents
=
async
()
=>
{
return
await
pool
.
query
(
'SELECT * FROM incident;'
);
};
// ... other CRUD methods for incident table
module
.
exports
=
{
createIncident
,
getIncidents
/* ... other CRUD methods */
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 19, 22:17 (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3274405
Default Alt Text
incidentModel.js (552 B)
Attached To
Mode
rSP ServPulse
Attached
Detach File
Event Timeline
Log In to Comment