@@ -68,8 +68,8 @@ public function getList(
6868 }
6969
7070 $ apiResponse = $ this ->annexeApiService ->getList ($ datastoreId , $ query );
71- $ response = new JsonResponse ($ apiResponse[ ' content ' ] , Response::HTTP_OK );
72- $ this ->setPaginatedHeaders ($ response , $ apiResponse[ ' headers ' ] ?? [] );
71+ $ response = new JsonResponse ($ apiResponse-> content , Response::HTTP_OK );
72+ $ this ->setPaginatedHeaders ($ response , $ apiResponse-> headers );
7373
7474 return $ response ;
7575 } catch (ApiException $ ex ) {
@@ -90,7 +90,7 @@ public function modify(string $datastoreId, string $annexeId, Request $request):
9090 $ data ['paths ' ] ?? null ,
9191 $ data ['labels ' ] ?? null ,
9292 $ data ['published ' ] ?? null
93- )
93+ )-> json ()
9494 );
9595 } catch (ApiException $ ex ) {
9696 throw new CartesApiException ($ ex ->getMessage (), $ ex ->getStatusCode (), $ ex ->getDetails ());
@@ -120,7 +120,7 @@ public function add(string $datastoreId, Request $request): JsonResponse
120120 public function getFileContent (string $ datastoreId , string $ annexeId ): Response
121121 {
122122 try {
123- $ fileContent = $ this ->annexeApiService ->download ($ datastoreId , $ annexeId );
123+ $ fileContent = $ this ->annexeApiService ->download ($ datastoreId , $ annexeId )-> text () ;
124124
125125 $ response = new Response ($ fileContent );
126126 $ response ->headers ->set ('Content-Type ' , Utils::guess_content_type ($ fileContent ));
@@ -179,7 +179,7 @@ public function addThumbnail(string $datastoreId, Request $request): JsonRespons
179179 $ annexes = $ this ->annexeApiService ->getAll ($ datastoreId , null , null , $ labels );
180180
181181 if (count ($ annexes )) { // Elle existe, on la supprime sinon le path ne change pas
182- $ this ->annexeApiService ->remove ($ datastoreId , $ annexes [0 ]['_id ' ]);
182+ $ this ->annexeApiService ->remove ($ datastoreId , $ annexes [0 ]['_id ' ])-> wait () ;
183183 }
184184
185185 $ annexe = $ this ->annexeApiService ->add ($ datastoreId , $ file ->getRealPath (), [$ path ], $ labels );
@@ -191,7 +191,7 @@ public function addThumbnail(string $datastoreId, Request $request): JsonRespons
191191 return new JsonResponse ($ annexe );
192192 }
193193
194- $ xmlFileContent = $ this ->metadataApiService ->downloadFile ($ datastoreId , $ metadata ['_id ' ]);
194+ $ xmlFileContent = $ this ->metadataApiService ->downloadFile ($ datastoreId , $ metadata ['_id ' ])-> text () ;
195195 $ cswMetadata = $ this ->metadataHelper ->fromXml ($ xmlFileContent );
196196 $ cswMetadata ->thumbnailUrl = $ annexe ['url ' ];
197197
@@ -215,7 +215,7 @@ public function deleteThumbnail(string $datastoreId, string $datasheetName, stri
215215 return $ response ;
216216 }
217217
218- $ xmlFileContent = $ this ->metadataApiService ->downloadFile ($ datastoreId , $ metadata ['_id ' ]);
218+ $ xmlFileContent = $ this ->metadataApiService ->downloadFile ($ datastoreId , $ metadata ['_id ' ])-> text () ;
219219 $ cswMetadata = $ this ->metadataHelper ->fromXml ($ xmlFileContent );
220220 $ cswMetadata ->thumbnailUrl = null ;
221221
@@ -229,7 +229,7 @@ public function deleteThumbnail(string $datastoreId, string $datasheetName, stri
229229 public function deleteAnnexe (string $ datastoreId , string $ annexeId ): JsonResponse
230230 {
231231 try {
232- $ this ->annexeApiService ->remove ($ datastoreId , $ annexeId );
232+ $ this ->annexeApiService ->remove ($ datastoreId , $ annexeId )-> wait () ;
233233
234234 return new JsonResponse (null , JsonResponse::HTTP_NO_CONTENT );
235235 } catch (ApiException $ ex ) {
0 commit comments