File tree 1 file changed +25
-0
lines changed 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,31 @@ async def post_import(request: Request, project_id: str):
75
75
return responses .JSONResponse (status_code = status .HTTP_200_OK , content = resp .json ())
76
76
77
77
78
+ @app .post ("/project/{project_id}/associations" )
79
+ async def post_associations (request : Request , project_id : str ):
80
+ try :
81
+ user_id = get_user_id_from_request (request )
82
+ except KeyError :
83
+ return responses .JSONResponse (
84
+ status_code = status .HTTP_401_UNAUTHORIZED ,
85
+ content = {"error_code" : ErrorCodes .UNRECOGNIZED_USER },
86
+ )
87
+ request_body = await request .json ()
88
+ url = f"{ BASE_URI } /project/{ project_id } /associations"
89
+ resp = requests .post (
90
+ url ,
91
+ json = {
92
+ "user_id" : user_id ,
93
+ "associations" : request_body ["associations" ],
94
+ "indices" : request_body ["indices" ],
95
+ "name" : request_body ["name" ],
96
+ "label_task_name" : request_body ["label_task_name" ],
97
+ "source_type" : request_body ["source_type" ],
98
+ },
99
+ )
100
+ return responses .JSONResponse (status_code = status .HTTP_200_OK , content = resp .json ())
101
+
102
+
78
103
@app .get ("/project/{project_id}" )
79
104
def get_details (request : Request , project_id : str ):
80
105
try :
You can’t perform that action at this time.
0 commit comments