mirror of
https://github.com/hcengineering/platform.git
synced 2025-03-19 05:08:12 +00:00
UBERF-7734: Fix total with find with limit === 1 (#6187)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
77d09dd645
commit
62e2f18331
@ -749,10 +749,14 @@ abstract class MongoAdapterBase implements DbAdapter {
|
||||
}
|
||||
|
||||
const doc = await coll.findOne(mongoQuery, findOptions)
|
||||
if (doc != null) {
|
||||
return toFindResult([doc as unknown as T])
|
||||
let total = -1
|
||||
if (options.total === true) {
|
||||
total = await coll.countDocuments(mongoQuery)
|
||||
}
|
||||
return toFindResult([])
|
||||
if (doc != null) {
|
||||
return toFindResult([doc as unknown as T], total)
|
||||
}
|
||||
return toFindResult([], total)
|
||||
},
|
||||
{ mongoQuery }
|
||||
)
|
||||
|
@ -1,37 +1,12 @@
|
||||
FROM node:20-alpine AS build
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
RUN apk upgrade --update && apk add \
|
||||
coreutils \
|
||||
libxml2-dev \
|
||||
html2text \
|
||||
autoconf \
|
||||
automake \
|
||||
build-base \
|
||||
gcc
|
||||
|
||||
RUN cd ~ && \
|
||||
wget http://www.gnu.org/software/unrtf/unrtf-0.21.9.tar.gz && \
|
||||
tar xzvf unrtf-0.21.9.tar.gz && \
|
||||
cd unrtf-0.21.9/ && \
|
||||
./bootstrap && \
|
||||
./configure && \
|
||||
make && \
|
||||
make install
|
||||
|
||||
|
||||
FROM node:20-alpine AS runtime
|
||||
|
||||
RUN apk upgrade --update && apk add \
|
||||
coreutils \
|
||||
antiword \
|
||||
poppler-utils \
|
||||
html2text
|
||||
html2text \
|
||||
unrtf
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=build /usr/local/bin/unrtf /usr/local/bin
|
||||
RUN mkdir /usr/local/share/unrtf
|
||||
COPY --from=build /usr/local/share/unrtf/* /usr/local/share/unrtf/
|
||||
WORKDIR /usr/src/app
|
||||
RUN npm install --ignore-scripts=false --verbose sharp@v0.30.2 pdfjs-dist@v2.12.313 --unsafe-perm
|
||||
COPY bundle/bundle.js ./
|
||||
|
Loading…
Reference in New Issue
Block a user