Log even more garbage
Test / test (push) Failing after 54s
Details
Test / test (push) Failing after 54s
Details
This commit is contained in:
parent
121cc90de9
commit
b816cb56da
|
|
@ -136,19 +136,31 @@ export default function start(self: ServiceWorkerGlobalScope) {
|
||||||
subscription: PushSubscription,
|
subscription: PushSubscription,
|
||||||
db: ReturnType<typeof database>
|
db: ReturnType<typeof database>
|
||||||
) {
|
) {
|
||||||
const response = await fetch(`${process.env.BASE_URL}/api/subscription/`, {
|
try {
|
||||||
method: "POST",
|
await sendMessage({
|
||||||
body: JSON.stringify(subscription),
|
message: `URL ${process.env.BASE_URL}/api/subscription/`,
|
||||||
})
|
})
|
||||||
|
|
||||||
await sendMessage({
|
const response = await fetch(
|
||||||
message: `Response status ${response.status}`,
|
`${process.env.BASE_URL}/api/subscription/`,
|
||||||
})
|
{
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify(subscription),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
db.subscriptions.put({
|
await sendMessage({
|
||||||
id: 1,
|
message: `Response status ${response.status}`,
|
||||||
subscriptionId: (await response.json()).subscriptionId,
|
})
|
||||||
})
|
db.subscriptions.put({
|
||||||
|
id: 1,
|
||||||
|
subscriptionId: (await response.json()).subscriptionId,
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
await sendMessage({
|
||||||
|
message: `ERRRROR ${(error as Error).toString()}}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function putSubscription(subscription: PushSubscription, id: number) {
|
function putSubscription(subscription: PushSubscription, id: number) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue