mirror of
https://github.com/strapi/strapi.git
synced 2025-11-27 23:54:18 +00:00
fix: change the updateDocument setCreator in case of new locale
This commit is contained in:
parent
ec7fb54b20
commit
0b7f833b6f
@ -104,7 +104,9 @@ const updateDocument = async (ctx: any, opts?: Options) => {
|
|||||||
const pickPermittedFields = documentVersion
|
const pickPermittedFields = documentVersion
|
||||||
? permissionChecker.sanitizeUpdateInput(documentVersion)
|
? permissionChecker.sanitizeUpdateInput(documentVersion)
|
||||||
: permissionChecker.sanitizeCreateInput;
|
: permissionChecker.sanitizeCreateInput;
|
||||||
const setCreator = setCreatorFields({ user, isEdition: true });
|
const setCreator = documentVersion
|
||||||
|
? setCreatorFields({ user, isEdition: true })
|
||||||
|
: setCreatorFields({ user });
|
||||||
const sanitizeFn = async.pipe(pickPermittedFields, setCreator as any);
|
const sanitizeFn = async.pipe(pickPermittedFields, setCreator as any);
|
||||||
const sanitizedBody = await sanitizeFn(body);
|
const sanitizedBody = await sanitizeFn(body);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user