Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 436191418b | |||
| 9179492026 | |||
| dc60b5147e |
@@ -989,10 +989,7 @@ class DefaultController extends ControllerAbstract {
|
||||
isset($data['variant']) && is_string($data['variant']) ? $data['variant'] : 'inline',
|
||||
);
|
||||
if ($preview === null) {
|
||||
return new JsonResponse([
|
||||
'status' => 'error',
|
||||
'error' => ['code' => 404, 'message' => 'Preview unavailable'],
|
||||
], Response::HTTP_NOT_FOUND);
|
||||
return new Response('', Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
return new StreamedResponse($preview->resource->stream(), Response::HTTP_OK, [
|
||||
|
||||
+8
-12
@@ -2,7 +2,8 @@
|
||||
|
||||
namespace KTXM\MailManager;
|
||||
|
||||
use KTXF\Module\ModuleBrowserInterface;
|
||||
use KTXF\Module\Configuration\BrowserModuleContextInterface;
|
||||
use KTXF\Module\Configuration\ModuleContextInterface;
|
||||
use KTXF\Module\ModuleInstanceAbstract;
|
||||
|
||||
/**
|
||||
@@ -11,7 +12,7 @@ use KTXF\Module\ModuleInstanceAbstract;
|
||||
* Provides unified mail sending and management across multiple providers
|
||||
* with context-aware service discovery and queued delivery.
|
||||
*/
|
||||
class Module extends ModuleInstanceAbstract implements ModuleBrowserInterface
|
||||
class Module extends ModuleInstanceAbstract
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
@@ -58,15 +59,10 @@ class Module extends ModuleInstanceAbstract implements ModuleBrowserInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function registerBI(): array {
|
||||
return [
|
||||
'handle' => $this->handle(),
|
||||
'namespace' => 'MailManager',
|
||||
'version' => $this->version(),
|
||||
'label' => $this->label(),
|
||||
'author' => $this->author(),
|
||||
'description' => $this->description(),
|
||||
'boot' => 'static/module.mjs',
|
||||
];
|
||||
public function configure(ModuleContextInterface $context): void
|
||||
{
|
||||
if ($context instanceof BrowserModuleContextInterface) {
|
||||
$context->registerModule($this, 'MailManager', 'static/module.mjs');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,6 +199,9 @@ export async function transceiveBlob<TRequest>(operation: string, data: TRequest
|
||||
await fetchWrapper.post(API_URL, request, {
|
||||
headers: { 'Accept': '*/*' },
|
||||
onStream: async (response: Response) => {
|
||||
if (response.status === 204) {
|
||||
throw new Error(`[${operation}] Preview unavailable`);
|
||||
}
|
||||
blob = await response.blob();
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user