insert , to origin list

This commit is contained in:
2025-05-27 15:38:40 +03:30
parent 6f8f9463b0
commit 44d3960f94
3 changed files with 18 additions and 2 deletions

View File

@@ -290,7 +290,7 @@ CORS_ALLOWED_ORIGINS = (
'http://127.0.0.1:3000',
'http://localhost:3000',
'http://192.168.88.130:3000',
'https://rasadyar.net'
'https://rasadyar.net',
'https://rasaddam-front.liara.run'
)

View File

@@ -71,6 +71,7 @@ class TagAssignment(BaseModel):
('A', 'Accept'),
('W', 'Waiting'),
('C', 'Cancel'),
('E', 'Exited'),
)
status = models.CharField(max_length=1, choices=status_choices, default="W")

View File

@@ -166,7 +166,7 @@ class TagAssignmentViewSet(viewsets.ModelViewSet):
f'tag_assignment_document_{assignment.serial}.{str(document).split(".")[1]}'
)
assignment.document = document_url
assignment.status = 'A'
assignment.status = 'E'
assignment.save()
serializer = self.serializer_class(assignment)
return Response(serializer.data, status=status.HTTP_200_OK)
@@ -192,6 +192,21 @@ class TagAssignmentViewSet(viewsets.ModelViewSet):
return Response(status.HTTP_200_OK)
@action(
methods=['post'],
detail=True,
url_name='remove_tags_by_id',
url_path='remove_tags_by_id',
name='remove_tags_by_id'
)
def remove_assigned_tags_by_id(self, request, pk=None):
allocated_tag = tag_models.AllocatedTags.objects.filter(id__in=request.data['allocated_tag_ids'])
for obj in allocated_tag:
obj.tag.status = 'F'
obj.tag.save()
allocated_tag.delete()
return Response(status.HTTP_200_OK)
@action(
methods=['put'],
detail=True,