feat: Add support for asynchronous invocation of FilesAdapter.getFileLocation (#9271)

This commit is contained in:
Vahid Sane
2024-08-27 18:39:19 +03:30
committed by GitHub
parent 2a63129ff6
commit 1a2da4055a
7 changed files with 102 additions and 49 deletions

View File

@@ -263,7 +263,7 @@ export class FilesRouter {
const { filename } = req.params;
// run beforeDeleteFile trigger
const file = new Parse.File(filename);
file._url = filesController.adapter.getFileLocation(req.config, filename);
file._url = await filesController.adapter.getFileLocation(req.config, filename);
const fileObject = { file, fileSize: null };
await triggers.maybeRunFileTrigger(
triggers.Types.beforeDelete,

View File

@@ -264,7 +264,7 @@ export class UsersRouter extends ClassesRouter {
// Remove hidden properties.
UsersRouter.removeHiddenProperties(user);
req.config.filesController.expandFilesInObject(req.config, user);
await req.config.filesController.expandFilesInObject(req.config, user);
// Before login trigger; throws if failure
await maybeRunTrigger(