@cardinali-studio/adminkit 2.2.45 → 2.2.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,7 +132,7 @@ async function get(context) {
132
132
  }, 404);
133
133
  }
134
134
 
135
- async function post({ request, env, params }) {
135
+ async function post({ request, env, params, waitUntil }) {
136
136
  if (!env.DB || !env.DELIVERY_SECRET) return json({ ok: false, error: "Servizio non attivo" }, 503);
137
137
  const seg = segments(params.path);
138
138
  const token = seg[0] || "";
@@ -168,8 +168,12 @@ async function post({ request, env, params }) {
168
168
  `).bind(access.delivery.id, access.link.id, packageId, variant, now),
169
169
  ]);
170
170
  if(env.DELIVERY_EMAIL_ENABLED==='true'){
171
- const task=processDeliveryEmails(env).catch(()=>console.error('Download notification temporarily unavailable'));
172
- if(typeof context.waitUntil==='function')context.waitUntil(task);else await task;
171
+ try {
172
+ const task=processDeliveryEmails(env).catch(()=>console.error('Download notification temporarily unavailable'));
173
+ if(typeof waitUntil==='function')waitUntil(task);else await task;
174
+ } catch {
175
+ console.error('Download notification temporarily unavailable');
176
+ }
173
177
  }
174
178
  return json({
175
179
  ok: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardinali-studio/adminkit",
3
- "version": "2.2.45",
3
+ "version": "2.2.46",
4
4
  "type": "module",
5
5
  "description": "Motore riusabile di un pannello di amministrazione per siti Hugo su Cloudflare Pages: codec del front matter guidato dallo schema, form React, libreria media su R2. NIENTE di specifico di un sito qui dentro.",
6
6
  "license": "0BSD",