Merge pull request #27 from WDI-Ideas/development
transaction filters only success and fail
This commit is contained in:
@@ -959,13 +959,15 @@ class VersionCheck(APIView):
|
||||
model = AppVersion
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
|
||||
device_type = request.GET.get('type')
|
||||
|
||||
device_type = request.GET.get("type")
|
||||
|
||||
if not device_type:
|
||||
return ApiResponse.error(message=constants.FAILURE, errors="device type is required")
|
||||
return ApiResponse.error(
|
||||
message=constants.FAILURE, errors="device type is required"
|
||||
)
|
||||
# Query the database to retrieve the upgrade flags based on the app version
|
||||
version = self.model.objects.filter(app_type=device_type).last()
|
||||
version_data = AppVersionSerializer(version)
|
||||
|
||||
return ApiResponse.success(message=constants.SUCCESS, data=version_data.data)
|
||||
return ApiResponse.success(message=constants.SUCCESS, data=version_data.data)
|
||||
|
||||
@@ -140,7 +140,13 @@ class TransactionView(APIView):
|
||||
permission_classes = [IsAuthenticated]
|
||||
|
||||
def get(self, request):
|
||||
queryset = models.Transaction.objects.filter(principal_id=request.user.id)
|
||||
queryset = models.Transaction.objects.filter(
|
||||
principal_id=request.user.id,
|
||||
transaction_status__in=[
|
||||
models.TransactionStatus.SUCCESS,
|
||||
models.TransactionStatus.FAIL,
|
||||
],
|
||||
)
|
||||
serializer = serializers.TransactionSerializer(queryset, many=True)
|
||||
|
||||
response = {
|
||||
|
||||
Reference in New Issue
Block a user