fix: get list of file under folder return all file in subfolder
This commit is contained in:
parent
93f0ac3431
commit
046b915fc3
6 changed files with 234 additions and 7 deletions
|
|
@ -43,8 +43,8 @@ export class FileController extends Controller {
|
|||
const search = await esClient.search<StorageFile & { attachment: Record<string, string> }>({
|
||||
index: DEFAULT_INDEX!,
|
||||
query: {
|
||||
prefix: {
|
||||
pathname: `${cabinetName}/${drawerName}/${folderName}/`,
|
||||
match: {
|
||||
path: `${cabinetName}/${drawerName}/${folderName}/`,
|
||||
},
|
||||
},
|
||||
size: 10000,
|
||||
|
|
@ -115,6 +115,7 @@ export class FileController extends Controller {
|
|||
|
||||
const metadata: Partial<StorageFile> = {
|
||||
pathname,
|
||||
path: basePath,
|
||||
fileName: body.file,
|
||||
fileSize: 0,
|
||||
fileType: "",
|
||||
|
|
@ -201,6 +202,7 @@ export class FileController extends Controller {
|
|||
id,
|
||||
doc: {
|
||||
pathname: destination,
|
||||
path: basePath,
|
||||
fileName: body.file,
|
||||
updatedAt: new Date().toISOString(),
|
||||
updatedBy: request.user.preferred_username ?? "n/a",
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ export class SubFolderFileController extends Controller {
|
|||
const search = await esClient.search<StorageFile & { attachment: Record<string, string> }>({
|
||||
index: DEFAULT_INDEX!,
|
||||
query: {
|
||||
prefix: {
|
||||
pathname: `${cabinetName}/${drawerName}/${folderName}/${subFolderName}`,
|
||||
match: {
|
||||
path: `${cabinetName}/${drawerName}/${folderName}/${subFolderName}/`,
|
||||
},
|
||||
},
|
||||
size: 10000,
|
||||
|
|
@ -119,6 +119,7 @@ export class SubFolderFileController extends Controller {
|
|||
|
||||
const metadata: Partial<StorageFile> = {
|
||||
pathname,
|
||||
path: basePath,
|
||||
fileName: body.file,
|
||||
fileSize: 0,
|
||||
fileType: "",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue