🐛 backend: fix bug with postgres support when uploading files (#646)

* 🐛 backend: fix bug with postgres support when uploading files and e2e fix by @MontaGhanmy (this is a squashed commit)

Co-authored-by: Monta <monta@HP-ProBook-445-14-inch-G9-Notebook-PC-505aadfc.localdomain>
This commit is contained in:
ericlinagora
2024-09-18 00:01:54 +02:00
committed by GitHub
parent f14ec8bd2d
commit 7929c2d12c
3 changed files with 29 additions and 6 deletions
@@ -227,7 +227,7 @@ export class DocumentsService {
if (options?.pagination) {
const { page_token, limitStr } = options.pagination;
const pageNumber =
dbType === "mongodb" ? parseInt(page_token) : parseInt(page_token) / parseInt(limitStr) + 1;
dbType === "mongodb" ? parseInt(page_token) : parseInt(page_token) / parseInt(limitStr);
pagination = new Pagination(`${pageNumber}`, `${limitStr}`, false);
}
@@ -441,7 +441,7 @@ export class DocumentsService {
);
// TODO: notify the user a document has been added to the directory shared with them
try {
if (driveItem.parent_id !== "root" && driveItem.parent_id !== "trash") {
if (!isVirtualFolder(driveItem.parent_id)) {
const parentItem = await this.repository.findOne(
{
id: driveItem.parent_id,