fix: wrong path

This commit is contained in:
Methapon2001 2023-11-29 17:43:55 +07:00
parent a3c5188103
commit 0691f29409
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
4 changed files with 13 additions and 13 deletions

View file

@ -114,7 +114,8 @@ export class CabinetController extends Controller {
list.map(async (current) => {
if (!current.name) return;
const destination = `${replaceIllegalChars(body.name)}/${current.name.slice(path.length)}`;
const base = `${replaceIllegalChars(body.name)}/`;
const destination = `${base}${current.name.slice(path.length)}`;
const source = `/${DEFAULT_BUCKET}/${current.name}`;
return await minioClient
@ -138,7 +139,7 @@ export class CabinetController extends Controller {
await esClient.update({
index: DEFAULT_INDEX!,
id: data._id,
doc: { pathname: destination, path },
doc: { pathname: destination, path: destination.split("/").splice(0, -1).join("/") },
refresh: "wait_for",
});