Skip to content

Commit

Permalink
fix: populate globals without values in request data (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
elitonzky authored Oct 4, 2024
1 parent 2716fd4 commit b7a012d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion retail/api/integrated_feature/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,19 @@ def post(self, request, *args, **kwargs):
fill_globals_usecase = PopulateGlobalsValuesUsecase(
self.integrations_service, self.flows_service
)
globals_values_request = {}
for globals_values in feature_version.globals_values:
globals_values_request[globals_values] = ""

for key, value in request.data.get("globals_values", {}).items():
globals_values_request[key] = value

treated_globals_values = fill_globals_usecase.execute(
request.data.get("globals_values", {}),
globals_values_request,
request.user.email,
request.data["project_uuid"],
)

# Add all globals from the request, including treated ones
for globals_key, globals_value in treated_globals_values.items():
integrated_feature.globals_values[globals_key] = globals_value
Expand Down

0 comments on commit b7a012d

Please sign in to comment.