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