do not fail when webhook endpoint doesn't exist
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
export async function webhookUserReported(endpoint: string, uuid: string) {
|
||||
await fetch(endpoint, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
user: uuid
|
||||
})
|
||||
});
|
||||
try {
|
||||
await fetch(endpoint, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
user: uuid
|
||||
})
|
||||
});
|
||||
} catch (e) {
|
||||
throw (e as { message: string }).message;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user