api: add succeeded to scan data labels

This commit is contained in:
Fam Zheng 2025-05-25 11:52:26 +01:00
parent 85bda4052f
commit a7c16716f7

View File

@ -1890,7 +1890,7 @@ class ScanDataLabelsView(BaseView):
def get(self, request):
ret = []
for x in ScanData.objects.all().filter(labels__isnull=False).order_by('pk').values('id', 'labels', 'image', 'code'):
for x in ScanData.objects.all().filter(labels__isnull=False).order_by('pk').values('id', 'labels', 'image', 'code', 'succeeded'):
if not x.get('labels'):
continue
ret.append({
@ -1898,6 +1898,7 @@ class ScanDataLabelsView(BaseView):
'labels': x.get('labels'),
'code': x.get('code'),
'image': x.get('image'),
'succeeded': x.get('succeeded'),
})
return JsonResponse({
'items': ret,