[WEB-2500] feat: Product updates modal (What's new in Plane) (#5690)

* [WEB-2500] feat: Product updates modal (What's new in Plane)

* fix: build errors.

* fix: lint errors resolved.

* chore: minor improvements.

* chore: minor fixes
This commit is contained in:
Prateek Shourya 2024-10-29 19:26:00 +05:30 committed by GitHub
parent c423d7d9df
commit 4bc751b7ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 250 additions and 151 deletions

View file

@ -0,0 +1,35 @@
# Python imports
import requests
# Django imports
from django.conf import settings
# Third party imports
from rest_framework.response import Response
from rest_framework import status
from rest_framework.permissions import AllowAny
# plane imports
from .base import BaseAPIView
class ChangeLogEndpoint(BaseAPIView):
permission_classes = [
AllowAny,
]
def fetch_change_logs(self):
response = requests.get(settings.INSTANCE_CHANGELOG_URL)
response.raise_for_status()
return response.json()
def get(self, request):
# Fetch the changelog
if settings.INSTANCE_CHANGELOG_URL:
data = self.fetch_change_logs()
return Response(data, status=status.HTTP_200_OK)
else:
return Response(
{"error": "could not fetch changelog please try again later"},
status=status.HTTP_400_BAD_REQUEST,
)