From 37d0b08b11b4baff13abc796183b9749cb109b00 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:51:34 +0700 Subject: [PATCH] fix: missing trailing slash in path --- Services/server/src/controllers/cabinetController.ts | 5 ++++- Services/server/src/controllers/drawerController.ts | 5 ++++- Services/server/src/controllers/folderController.ts | 5 ++++- Services/server/src/controllers/subFolderController.ts | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Services/server/src/controllers/cabinetController.ts b/Services/server/src/controllers/cabinetController.ts index 6e6f7f4..0f22ebb 100644 --- a/Services/server/src/controllers/cabinetController.ts +++ b/Services/server/src/controllers/cabinetController.ts @@ -139,7 +139,10 @@ export class CabinetController extends Controller { await esClient.update({ index: DEFAULT_INDEX!, id: data._id, - doc: { pathname: destination, path: destination.split("/").slice(0, -1).join("/") }, + doc: { + pathname: destination, + path: destination.split("/").slice(0, -1).join("/") + "/", + }, refresh: "wait_for", }); diff --git a/Services/server/src/controllers/drawerController.ts b/Services/server/src/controllers/drawerController.ts index bdd300d..804e942 100644 --- a/Services/server/src/controllers/drawerController.ts +++ b/Services/server/src/controllers/drawerController.ts @@ -156,7 +156,10 @@ export class DrawerController extends Controller { await esClient.update({ index: DEFAULT_INDEX!, id: data._id, - doc: { pathname: destination, path: destination.split("/").slice(0, -1).join("/") }, + doc: { + pathname: destination, + path: destination.split("/").slice(0, -1).join("/") + "/", + }, refresh: "wait_for", }); diff --git a/Services/server/src/controllers/folderController.ts b/Services/server/src/controllers/folderController.ts index 322d332..cc8ce50 100644 --- a/Services/server/src/controllers/folderController.ts +++ b/Services/server/src/controllers/folderController.ts @@ -163,7 +163,10 @@ export class FolderController extends Controller { await esClient.update({ index: DEFAULT_INDEX!, id: data._id, - doc: { pathname: destination, path: destination.split("/").slice(0, -1).join("/") }, + doc: { + pathname: destination, + path: destination.split("/").slice(0, -1).join("/") + "/", + }, refresh: "wait_for", }); diff --git a/Services/server/src/controllers/subFolderController.ts b/Services/server/src/controllers/subFolderController.ts index 2d2f04c..08dab6d 100644 --- a/Services/server/src/controllers/subFolderController.ts +++ b/Services/server/src/controllers/subFolderController.ts @@ -166,7 +166,10 @@ export class SubFolderController extends Controller { await esClient.update({ index: DEFAULT_INDEX!, id: data._id, - doc: { pathname: destination, path: destination.split("/").slice(0, -1).join("/") }, + doc: { + pathname: destination, + path: destination.split("/").slice(0, -1).join("/") + "/", + }, refresh: "wait_for", });