Skip to content

Commit

Permalink
Merge pull request #75 from AI4Bharat/small_fix_swagger
Browse files Browse the repository at this point in the history
Small fix swagger
  • Loading branch information
aparna-aa authored May 21, 2024
2 parents f4d48ef + ed5437d commit 791076a
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 11 deletions.
4 changes: 2 additions & 2 deletions backend/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2437,7 +2437,7 @@ def assign_new_review_tasks(self, request, pk, *args, **kwargs):
).count()
if reviewer_anno_count == 0:
base_annotation_obj = Annotation_model(
result=[],
result=rec_ann[0].result,
task=task,
completed_by=cur_user,
annotation_status="unreviewed",
Expand Down Expand Up @@ -2664,7 +2664,7 @@ def assign_new_supercheck_tasks(self, request, pk, *args, **kwargs):
).count()
if superchecker_anno_count == 0:
base_annotation_obj = Annotation_model(
result=[],
result=rec_ann[0].result,
task=task,
completed_by=cur_user,
annotation_status="unvalidated",
Expand Down
73 changes: 64 additions & 9 deletions backend/tasks/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,16 +1001,71 @@ def delete_project_tasks(self, request, pk=None):
)

@swagger_auto_schema(
method="post",
request_body=openapi.Schema(
type=openapi.TYPE_OBJECT,
properties={
"user_id": openapi.Schema(type=openapi.TYPE_INTEGER),
"task_type": openapi.Schema(type=openapi.TYPE_STRING),
},
required=["user_id"],
),
method="get",
manual_parameters=[
openapi.Parameter(
"user_id",
openapi.IN_QUERY,
description=(
"A integer refering to the user id for which tasks are to be fetched"
),
type=openapi.TYPE_INTEGER,
required=False,
),
openapi.Parameter(
"task_type",
openapi.IN_QUERY,
description=(
"A string refering to the task type for which tasks are to be fetched"
),
type=openapi.TYPE_STRING,
required=False,
),
openapi.Parameter(
"search_Project ID",
openapi.IN_QUERY,
description=(
"A integer refering to the project id for which tasks are to be fetched"
),
type=openapi.TYPE_INTEGER,
required=False,
),
openapi.Parameter(
"search_Task ID",
openapi.IN_QUERY,
description=(
"A integer refering to the task id for which tasks are to be fetched"
),
type=openapi.TYPE_INTEGER,
required=False,
),
openapi.Parameter(
"search_Updated at",
openapi.IN_QUERY,
description=(
"A integer refering to the updated at time for which tasks are to be fetched"
),
type=openapi.TYPE_INTEGER,
required=False,
),
openapi.Parameter(
"search_Annotated at",
openapi.IN_QUERY,
description=(
"A integer refering to the annotated at time for which tasks are to be fetched"
),
type=openapi.TYPE_INTEGER,
required=False,
),
openapi.Parameter(
"search_Created at",
openapi.IN_QUERY,
description=(
"A integer refering to the created at time for which tasks are to be fetched"
),
type=openapi.TYPE_INTEGER,
required=False,
),
openapi.Parameter(
"page",
openapi.IN_QUERY,
Expand Down

0 comments on commit 791076a

Please sign in to comment.