fix: Fetching the Strapi app env

pull/31/head
Boaz Poolman 2021-12-09 09:20:46 +01:00
parent 1734977a11
commit bfccce21de
2 changed files with 4 additions and 2 deletions

View File

@ -84,7 +84,7 @@ export function setLoadingState(value) {
export function getAppEnv(toggleNotification) { export function getAppEnv(toggleNotification) {
return async function(dispatch) { return async function(dispatch) {
try { try {
const env = await request('/config-sync/app-env', { const { env } = await request('/config-sync/app-env', {
method: 'GET', method: 'GET',
}); });
dispatch(setAppEnvInState(env)); dispatch(setAppEnvInState(env));

View File

@ -88,5 +88,7 @@ module.exports = {
* Get the current Strapi env. * Get the current Strapi env.
* @returns {string} The current Strapi environment. * @returns {string} The current Strapi environment.
*/ */
getAppEnv: async () => strapi.server.app.env, getAppEnv: async () => {
return { env: strapi.server.app.env };
},
}; };