Search request #29

Merged
KevinMidboe merged 6 commits from searchRequest into master 2017-09-20 08:49:29 +00:00
Showing only changes of commit ae66e9a684 - Show all commits

View File

@@ -6,10 +6,10 @@ function searchRequestController(req, res) {
console.log('searchReq: ' + query, page, type);
requestRepository.searchRequest(query, page, type)
.then((movies) => {
.then((searchResult) => {
// Verify that respond has content, if so send the content back
if (movies.length > 0 && movies != null) {
res.send(movies);
if (searchResult.results.length > 0) {
res.send(searchResult);
}
// If no content was found, send 404 status and error message
else {