mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Indent payload overrides in import endpoint under data
This commit is contained in:
@@ -117,6 +117,7 @@ router.post(
|
||||
|
||||
const importSchema = Joi.object({
|
||||
url: Joi.string().required(),
|
||||
data: Joi.object()
|
||||
});
|
||||
|
||||
router.post(
|
||||
@@ -142,11 +143,9 @@ router.post(
|
||||
storage: (env.STORAGE_LOCATIONS as string).split(',')[0].trim(),
|
||||
type: fileResponse.headers['content-type'],
|
||||
title: formatTitle(filename),
|
||||
...req.body,
|
||||
...(req.body.data || {}),
|
||||
};
|
||||
|
||||
delete payload.url;
|
||||
|
||||
const primaryKey = await service.upload(fileResponse.data, payload);
|
||||
const record = await service.readByKey(primaryKey, req.sanitizedQuery);
|
||||
res.locals.payload = { data: record || null };
|
||||
|
||||
Reference in New Issue
Block a user