Skip to content

Commit bfccce2

Browse files
committed
fix: Fetching the Strapi app env
1 parent 1734977 commit bfccce2

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

admin/src/state/actions/Config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function setLoadingState(value) {
8484
export function getAppEnv(toggleNotification) {
8585
return async function(dispatch) {
8686
try {
87-
const env = await request('/config-sync/app-env', {
87+
const { env } = await request('/config-sync/app-env', {
8888
method: 'GET',
8989
});
9090
dispatch(setAppEnvInState(env));

server/controllers/config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,7 @@ module.exports = {
8888
* Get the current Strapi env.
8989
* @returns {string} The current Strapi environment.
9090
*/
91-
getAppEnv: async () => strapi.server.app.env,
91+
getAppEnv: async () => {
92+
return { env: strapi.server.app.env };
93+
},
9294
};

0 commit comments

Comments
 (0)