mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix: Update ChillDocumentManager
. Fix statuscode and return types.
This commit is contained in:
parent
664fcd07ef
commit
86c2a5c3e8
@ -21,6 +21,7 @@ use Error;
|
||||
use loophp\psr17\Psr17Interface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use Symfony\Bridge\PsrHttpMessage\HttpMessageFactoryInterface;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Mime\MimeTypes;
|
||||
@ -103,7 +104,7 @@ final class ChillDocumentManager implements DocumentManagerInterface
|
||||
public function findByDocumentId(string $documentId): ?Document {
|
||||
return $this->storedObjectRepository->findOneBy(
|
||||
[
|
||||
'uuid' => $documentId,
|
||||
'uuid' => Uuid::fromString($documentId),
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -198,7 +199,7 @@ final class ChillDocumentManager implements DocumentManagerInterface
|
||||
->createStream($this->getContent($document));
|
||||
}
|
||||
|
||||
private function deleteContent(StoredObject $storedObject): string
|
||||
private function deleteContent(StoredObject $storedObject): void
|
||||
{
|
||||
/** @var StdClass $object */
|
||||
$object = $this->tempUrlGenerator->generate('DELETE', $storedObject->getFilename());
|
||||
@ -234,7 +235,7 @@ final class ChillDocumentManager implements DocumentManagerInterface
|
||||
|
||||
$response = $this->httpClient->request('PUT', $object->url, ['body' => $content]);
|
||||
|
||||
if (200 !== $response->getStatusCode())
|
||||
if (201 !== $response->getStatusCode())
|
||||
{
|
||||
throw new Error('Unable to save stored object.');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user