BUG FIX: in searchBelongings req.query passed to the service
This commit is contained in:
@@ -2,11 +2,14 @@ const catchAsync = require('../../globalErrorHandler/catchAsync')
|
|||||||
const belongingService = require('./belongingService')
|
const belongingService = require('./belongingService')
|
||||||
|
|
||||||
exports.searchBelongings = catchAsync(async (req, res, next) => {
|
exports.searchBelongings = catchAsync(async (req, res, next) => {
|
||||||
const {facets, belongings, totalCount, pagesCount} = await belongingService.searchBelongings()
|
const { facets, belongings, totalCount, pagesCount } = await belongingService.searchBelongings(req.query)
|
||||||
|
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
status: 'success',
|
status: 'success',
|
||||||
facets, belongings, totalCount, pagesCount
|
facets,
|
||||||
|
belongings,
|
||||||
|
totalCount,
|
||||||
|
pagesCount,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -15,11 +18,10 @@ exports.indexAllBelongings = catchAsync(async (req, res, next) => {
|
|||||||
|
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
status: 'success',
|
status: 'success',
|
||||||
indexedCount
|
indexedCount,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
exports.getAllBelongings = catchAsync(async (req, res, next) => {
|
exports.getAllBelongings = catchAsync(async (req, res, next) => {
|
||||||
const belongings = await belongingService.getAllBelongings()
|
const belongings = await belongingService.getAllBelongings()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user