Skip to content

Commit

Permalink
fix: supprime attribute MapQueryParameter inutile
Browse files Browse the repository at this point in the history
  • Loading branch information
ocruze committed Nov 23, 2023
1 parent 10ebd77 commit 90e9f53
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/Services/EntrepotApi/AnnexeApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@

namespace App\Services\EntrepotApi;

use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpKernel\Attribute\MapQueryParameter;

class AnnexeApiService extends AbstractEntrepotApiService
{
public function getAll(
string $datastoreId,
#[MapQueryParameter] string $mimeType = null,
#[MapQueryParameter] string $path = null) : array
public function getAll(string $datastoreId, string $mimeType = null, string $path = null): array
{
$query = [];
if ($mimeType) {
$query['mime_type'] = $mimeType;
$query['mime_type'] = $mimeType;
}
if ($path) {
$query['path'] = $path;
$query['path'] = $path;
}

return $this->requestAll("datastores/$datastoreId/annexes", $query);
Expand Down Expand Up @@ -53,12 +47,12 @@ public function add(string $datastoreId, string $annexeFilePath, array $paths, a
public function replaceFile(string $datastoreId, string $annexeId, string $annexeFilePath): array
{
$response = $this->sendFile('PUT', "datastores/$datastoreId/annexes/$annexeId", $annexeFilePath);

$this->filesystem->remove($annexeFilePath);

return $response;
}

public function publish(string $datastoreId, string $annexeId): array
{
return $this->request('PATCH', "datastores/$datastoreId/annexes/$annexeId", [
Expand Down

0 comments on commit 90e9f53

Please sign in to comment.