1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: exclude favorites from the client api (#3276)

This commit is contained in:
Mateusz Kwasniewski 2023-03-08 14:56:51 +01:00 committed by GitHub
parent 9422dce9d5
commit 352ace1e6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -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;
}

View File

@ -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',
{