Catch onElementSave error and emit it back to the element
Add tce namespace inside config object
Fix async reducer
❗ This PR introduces a way of declaring TCE env variables.
The TCE env variables should be prefixed with TCE in .env file.
Example:
Declare TCE env variable inside .env file
// .env file
TCE_BRIGHTCOVE_VIDEO_API_KEY=myapikey
2. Declared env variable can be found inside config object in `tce` namespace. Env variable is converted to [camelCase](https://lodash.com/docs/4.17.15#camelCase) and the `TCE` prefix is dropped.
```js
const config = require('config/server');
console.log(config.tce.brightcoveVideoApiKey); // Prints "myapikey"
TCE HOOKS example
// tce-brightcove-video/server/index.js
function beforeSave(asset, { config }) {
console.log(config.tce.brightcoveVideoApiKey); // Prints "myapikey"
return asset;
}
❗ This PR introduces a way of declaring
TCE
env variables. TheTCE
env variables should be prefixed withTCE
in .env file.Example:
TCE_BRIGHTCOVE_VIDEO_API_KEY=myapikey
function beforeSave(asset, { config }) { console.log(config.tce.brightcoveVideoApiKey); // Prints "myapikey" return asset; }