mirror of
https://github.com/strapi/strapi.git
synced 2026-01-06 12:13:52 +00:00
Fix format context creation
This commit is contained in:
parent
456f945d1e
commit
b34d634c19
@ -27,16 +27,6 @@ const createValidateContext = permission => ({
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* Create a context from a domain {@link Permission} used by the format hook
|
||||
* @param {Permission} permission
|
||||
* @return {{ readonly permission: Permission }}
|
||||
*/
|
||||
const createFormatContext = permission => ({
|
||||
get permission() {
|
||||
return cloneDeep(permission);
|
||||
},
|
||||
});
|
||||
/**
|
||||
* Create a context from a domain {@link Permission} used by the before valuate hook
|
||||
* @param {Permission} permission
|
||||
@ -100,7 +90,6 @@ const createWillRegisterContext = ({ permission, options }) => ({
|
||||
module.exports = {
|
||||
createEngineHooks,
|
||||
createValidateContext,
|
||||
createFormatContext,
|
||||
createBeforeEvaluateContext,
|
||||
createWillRegisterContext,
|
||||
};
|
||||
|
||||
@ -8,7 +8,6 @@ const {
|
||||
createEngineHooks,
|
||||
createWillRegisterContext,
|
||||
createBeforeEvaluateContext,
|
||||
createFormatContext,
|
||||
createValidateContext,
|
||||
} = require('./hooks');
|
||||
|
||||
@ -67,9 +66,7 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
|
||||
const permission = await state.hooks['format.permission'].call(
|
||||
createFormatContext(params.permission)
|
||||
);
|
||||
const permission = await state.hooks['format.permission'].call(params.permission);
|
||||
|
||||
const postFormatValidation = await runValidationHook(
|
||||
'post-format::validate.permission',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user