ADD: Server urls

ADD: SearchBelongings function
REMOVE: API from docker compose (run it manually)
ADD: Required packages
REMOVE: Redundant import from TsApiFeatures
This commit is contained in:
2025-01-02 16:45:16 +03:30
parent 25a6978346
commit 1021774c89
7 changed files with 162 additions and 21 deletions
@@ -1,6 +1,15 @@
const catchAsync = require('../../globalErrorHandler/catchAsync')
const belongingService = require('./belongingService')
exports.searchBelongings = catchAsync(async (req, res, next) => {
const {facets, belongings, totalCount, pagesCount} = await belongingService.searchBelongings()
res.status(200).json({
status: 'success',
facets, belongings, totalCount, pagesCount
})
})
exports.indexAllBelongings = catchAsync(async (req, res, next) => {
const { indexedCount } = await belongingService.indexAllBelongings()