mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: exclude favorites from the client api (#3276)
This commit is contained in:
		
							parent
							
								
									9422dce9d5
								
							
						
					
					
						commit
						352ace1e6e
					
				@ -198,7 +198,6 @@ export default class FeatureToggleClientStore
 | 
			
		||||
            feature.impressionData = r.impression_data;
 | 
			
		||||
            feature.enabled = !!r.enabled;
 | 
			
		||||
            feature.name = r.name;
 | 
			
		||||
            feature.favorite = r.favorite;
 | 
			
		||||
            feature.description = r.description;
 | 
			
		||||
            feature.project = r.project;
 | 
			
		||||
            feature.stale = r.stale;
 | 
			
		||||
@ -206,6 +205,7 @@ export default class FeatureToggleClientStore
 | 
			
		||||
            feature.variants = r.variants || [];
 | 
			
		||||
            feature.project = r.project;
 | 
			
		||||
            if (isAdmin) {
 | 
			
		||||
                feature.favorite = r.favorite;
 | 
			
		||||
                feature.lastSeenAt = r.last_seen_at;
 | 
			
		||||
                feature.createdAt = r.created_at;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,7 @@
 | 
			
		||||
import { IUnleashTest, setupApp } from '../../helpers/test-helper';
 | 
			
		||||
import {
 | 
			
		||||
    IUnleashTest,
 | 
			
		||||
    setupAppWithCustomConfig,
 | 
			
		||||
} from '../../helpers/test-helper';
 | 
			
		||||
import dbInit, { ITestDb } from '../../helpers/database-init';
 | 
			
		||||
import getLogger from '../../../fixtures/no-logger';
 | 
			
		||||
import { DEFAULT_ENV } from '../../../../lib/util/constants';
 | 
			
		||||
@ -8,7 +11,13 @@ let db: ITestDb;
 | 
			
		||||
 | 
			
		||||
beforeAll(async () => {
 | 
			
		||||
    db = await dbInit('feature_api_client', getLogger);
 | 
			
		||||
    app = await setupApp(db.stores);
 | 
			
		||||
    app = await setupAppWithCustomConfig(db.stores, {
 | 
			
		||||
        experimental: {
 | 
			
		||||
            flags: {
 | 
			
		||||
                strictSchemaValidation: true,
 | 
			
		||||
            },
 | 
			
		||||
        },
 | 
			
		||||
    });
 | 
			
		||||
    await app.services.featureToggleServiceV2.createFeatureToggle(
 | 
			
		||||
        'default',
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user