mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Merge branch 'main' into sdk
This commit is contained in:
@@ -12,6 +12,7 @@ import url from 'url';
|
||||
import path from 'path';
|
||||
import useCollection from '../middleware/use-collection';
|
||||
import { respond } from '../middleware/respond';
|
||||
import { toArray } from '../utils/to-array';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
@@ -32,7 +33,7 @@ const multipartHandler = asyncHandler(async (req, res, next) => {
|
||||
* the row in directus_files async during the upload of the actual file.
|
||||
*/
|
||||
|
||||
let disk: string = (env.STORAGE_LOCATIONS as string).split(',')[0].trim();
|
||||
let disk: string = toArray(env.STORAGE_LOCATIONS)[0];
|
||||
let payload: Partial<File> = {};
|
||||
let fileCount = 0;
|
||||
|
||||
@@ -155,7 +156,7 @@ router.post(
|
||||
|
||||
const payload = {
|
||||
filename_download: filename,
|
||||
storage: (env.STORAGE_LOCATIONS as string).split(',')[0].trim(),
|
||||
storage: toArray(env.STORAGE_LOCATIONS)[0],
|
||||
type: fileResponse.headers['content-type'],
|
||||
title: formatTitle(filename),
|
||||
...(req.body.data || {}),
|
||||
|
||||
@@ -20,12 +20,12 @@ router.get('/ping', (req, res) => res.send('pong'));
|
||||
|
||||
router.get(
|
||||
'/info',
|
||||
(req, res, next) => {
|
||||
asyncHandler(async (req, res, next) => {
|
||||
const service = new ServerService({ accountability: req.accountability });
|
||||
const data = service.serverInfo();
|
||||
const data = await service.serverInfo();
|
||||
res.locals.payload = { data };
|
||||
return next();
|
||||
},
|
||||
}),
|
||||
respond
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user