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)
|
const doc = await coll.findOne(mongoQuery, findOptions)
|
||||||
if (doc != null) {
|
let total = -1
|
||||||
return toFindResult([doc as unknown as T])
|
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 }
|
{ 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
|
FROM node:20-alpine AS runtime
|
||||||
|
|
||||||
RUN apk upgrade --update && apk add \
|
RUN apk upgrade --update && apk add \
|
||||||
coreutils \
|
coreutils \
|
||||||
antiword \
|
antiword \
|
||||||
poppler-utils \
|
poppler-utils \
|
||||||
html2text
|
html2text \
|
||||||
|
unrtf
|
||||||
ENV NODE_ENV=production
|
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
|
WORKDIR /usr/src/app
|
||||||
RUN npm install --ignore-scripts=false --verbose sharp@v0.30.2 pdfjs-dist@v2.12.313 --unsafe-perm
|
RUN npm install --ignore-scripts=false --verbose sharp@v0.30.2 pdfjs-dist@v2.12.313 --unsafe-perm
|
||||||
COPY bundle/bundle.js ./
|
COPY bundle/bundle.js ./
|
||||||
|
Loading…
Reference in New Issue
Block a user