Design hotfixes and improvements.
Run Tests on Branches / Backend Tests (push) Successful in 3m32s
Run Tests on Branches / Frontend Tests (push) Successful in 3m29s

This commit is contained in:
Antoni Nuñez Romeu
2026-07-02 12:40:09 +02:00
parent 15c1127b34
commit 7606d118e4
17 changed files with 700 additions and 282 deletions
+3 -1
View File
@@ -35,7 +35,7 @@ export function pushSupported() {
}
export async function getVapidPublicKey() {
const res = await fetch('/api/notifications/vapid-public-key');
const res = await fetch('/api/notifications/vapid-public-key', { credentials: 'include' });
if (!res.ok) {
const message = res.status === 503
? 'Las notificaciones push no están configuradas en el servidor'
@@ -88,6 +88,7 @@ export async function subscribeToPush(medicineNregistro, medicineName, pharmacyI
const subscription = await getOrCreateSubscription();
const res = await fetch('/api/notifications/subscribe', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
medicine_nregistro: medicineNregistro,
@@ -115,6 +116,7 @@ export async function unsubscribeFromPush(medicineNregistro, pharmacyId = null)
if (endpoint) {
await fetch('/api/notifications/unsubscribe', {
method: 'DELETE',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
medicine_nregistro: medicineNregistro,