[api] Refactor _patch_operation_id_request in public APIs
@@ -167,11 +167,13 @@ def _get_interpreter_from_dialect(dialect, user):
def _patch_operation_id_request(django_request):
- if django_request.POST.get('operationId') and not django_request.POST.get('snippet'):
- data = {
- 'snippet': '{"type":"1","result":{}}',
- 'operationId': django_request.POST.get('operationId')
- }
+ data = {}
+
+ if not django_request.POST.get('snippet'):
+ data['snippet'] = '{"type":"mysql","result":{}}'
+
+ if django_request.POST.get('operationId'):
+ data['operationId'] = django_request.POST.get('operationId')
django_request.POST = QueryDict(mutable=True)
django_request.POST.update(data)
