File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 11const cacheHandle = require ( '../cache/handle' ) ;
22const getContent = require ( '../kontent/getContent' ) ;
3+ const isPreview = require ( '../kontent/isPreview' ) ;
34const getUrlMap = require ( '../general/urlMap' ) ;
45const github = require ( './github' ) ;
56
67const sync = async ( res ) => {
8+ let prefix = '' ;
9+ let suffix = '' ;
10+
11+ if ( process . env . IS_DEVELOPMENT === 'true' ) {
12+ prefix = 'dev_'
13+ }
14+
15+ if ( isPreview ( res . locals . previewapikey ) ) {
16+ suffix = '_preview' ;
17+ }
18+
719 const CACHE_KEY = 'redoclyData' ;
8- const FILE_PATH = ' siteData.json' ;
20+ const FILE_PATH = ` ${ prefix } siteData${ suffix } .json` ;
921
1022 const KCDetails = getContent . KCDetails ( res ) ;
1123 const redoclyDataExisting = cacheHandle . get ( CACHE_KEY , KCDetails ) ;
You can’t perform that action at this time.
0 commit comments