Added a function in requestRepo to fetch out all the requested items. And a sql statement to do so.

This commit is contained in:
2017-09-27 17:54:01 +02:00
parent f1f407c71c
commit 509759bca8

View File

@@ -20,7 +20,8 @@ class RequestRepository {
constructor(database) { constructor(database) {
this.database = database || establishedDatabase; this.database = database || establishedDatabase;
this.queries = { this.queries = {
'insertRequest': "INSERT INTO requests VALUES (?, ?, ?, ?, ?, ?, CURRENT_DATE)" 'insertRequest': "INSERT INTO requests VALUES (?, ?, ?, ?, ?, ?, CURRENT_DATE)",
'fetchRequstedItems': "SELECT * FROM requests",
} }
} }
@@ -162,6 +163,10 @@ class RequestRepository {
} }
fetchRequested() {
return this.database.all(this.queries.fetchRequstedItems);
}
} }
module.exports = RequestRepository; module.exports = RequestRepository;