From 509759bca8db2a2d6a87cae45352253cbbdf41da Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 27 Sep 2017 17:54:01 +0200 Subject: [PATCH] Added a function in requestRepo to fetch out all the requested items. And a sql statement to do so. --- seasoned_api/src/plex/requestRepository.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/seasoned_api/src/plex/requestRepository.js b/seasoned_api/src/plex/requestRepository.js index 0af3f2f..81d569b 100644 --- a/seasoned_api/src/plex/requestRepository.js +++ b/seasoned_api/src/plex/requestRepository.js @@ -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; \ No newline at end of file