fix meal api and force update api

This commit is contained in:
bobbyvish
2024-04-04 16:27:43 +05:30
parent 9e66760fae
commit 8878dc89ac
5 changed files with 53 additions and 9 deletions

View File

@@ -349,14 +349,18 @@ class AppleSignin(APIView):
class VersionCheck(APIView):
authentication_classes = []
permission_classes = []
model = AppVersion
def get(self, request, *args, **kwargs):
app_version = request.GET.get('appVersion')
device_type = request.GET.get('deviceType')
if not app_version or not device_type:
return ApiResponse.error(message=constants.FAILURE, errors="App version and device type is required")
# Query the database to retrieve the upgrade flags based on the app version
try:
version = AppVersion.objects.get(version=app_version)
except AppVersion.DoesNotExist:
version = self.model.objects.get(version=app_version)
except self.model.DoesNotExist:
version = None
if version: