Added a function in requestRepo to fetch out all the requested items. And a sql statement to do so.
This commit is contained in:
@@ -20,7 +20,8 @@ class RequestRepository {
|
||||
constructor(database) {
|
||||
this.database = database || establishedDatabase;
|
||||
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;
|
||||
Reference in New Issue
Block a user