Update Lighthouse show key response

This commit is contained in:
Chandrapal Badshah
2025-04-30 14:33:05 +05:30
parent 7ba1bd6876
commit 461eb7ab85
3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -5593,7 +5593,7 @@ class TestLighthouseConfigViewSet:
reverse("lighthouseconfig-show-key", kwargs={"pk": config_id})
)
assert response.status_code == status.HTTP_200_OK
assert response.json()["data"]["api_key"] == expected_api_key
assert response.json()["data"]["attributes"]["api_key"] == expected_api_key
def test_lighthouse_config_filters(
self, authenticated_client, lighthouse_config_fixture
+4 -3
View File
@@ -13,9 +13,7 @@ from config.settings.social_login import (
GITHUB_OAUTH_CALLBACK_URL,
GOOGLE_OAUTH_CALLBACK_URL,
)
from cryptography.fernet import Fernet
from dj_rest_auth.registration.views import SocialLoginView
from django.conf import settings
from django.conf import settings as django_settings
from django.contrib.postgres.aggregates import ArrayAgg
from django.contrib.postgres.search import SearchQuery
@@ -2884,7 +2882,10 @@ class LighthouseConfigViewSet(BaseRLSViewSet):
status=status.HTTP_400_BAD_REQUEST,
)
return Response(
{"api_key": decrypted_key},
data={
"type": "lighthouse-config",
"attributes": {"api_key": decrypted_key},
},
status=status.HTTP_200_OK,
)
except Exception as e:
+1 -1
View File
@@ -41,7 +41,7 @@ export const getAIKey = async (): Promise<string> => {
});
const data = await response.json();
return data.data.api_key;
return data.data.attributes.api_key;
};
export const createLighthouseConfig = async (config: {