1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: Default strategy event user (#5470)

This commit is contained in:
Mateusz Kwasniewski 2023-11-28 15:46:42 +01:00 committed by GitHub
parent 74e8d1139d
commit 05614ed20d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -162,7 +162,10 @@ export default class EnvironmentsController extends Controller {
} }
async updateDefaultStrategyForProjectEnvironment( async updateDefaultStrategyForProjectEnvironment(
req: Request<IProjectEnvironmentParams, CreateFeatureStrategySchema>, req: IAuthRequest<
IProjectEnvironmentParams,
CreateFeatureStrategySchema
>,
res: Response<CreateFeatureStrategySchema>, res: Response<CreateFeatureStrategySchema>,
): Promise<void> { ): Promise<void> {
const { projectId, environment } = req.params; const { projectId, environment } = req.params;
@ -172,6 +175,7 @@ export default class EnvironmentsController extends Controller {
environment, environment,
projectId, projectId,
strategy, strategy,
extractUsername(req),
); );
this.openApiService.respondWithValidation( this.openApiService.respondWithValidation(

View File

@ -131,7 +131,7 @@ export default class EnvironmentService {
environment: string, environment: string,
projectId: string, projectId: string,
strategy: CreateFeatureStrategySchema, strategy: CreateFeatureStrategySchema,
username: string = 'unknown', username: string,
): Promise<CreateFeatureStrategySchema> { ): Promise<CreateFeatureStrategySchema> {
if (strategy.name !== 'flexibleRollout') { if (strategy.name !== 'flexibleRollout') {
throw new BadDataError( throw new BadDataError(