mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-24 22:11:38 +02:00
chore: bruno notifications endpoint
This commit is contained in:
parent
13eef748e1
commit
63684afbff
@ -15,15 +15,11 @@ const registerNotificationsIpc = (mainWindow, watcher) => {
|
|||||||
|
|
||||||
module.exports = registerNotificationsIpc;
|
module.exports = registerNotificationsIpc;
|
||||||
|
|
||||||
const fetchNotifications = async (props) => {
|
const fetchNotifications = async () => {
|
||||||
try {
|
try {
|
||||||
const { lastNotificationId } = props || {};
|
let url = process.env.BRUNO_INFO_ENDPOINT || 'https://appinfo.usebruno.com';
|
||||||
let url = process.env.BRUNO_INFO_ENDPOINT;
|
|
||||||
if (!url) {
|
|
||||||
return Promise.reject('Invalid notifications endpoint', error);
|
|
||||||
}
|
|
||||||
if (lastNotificationId) url += `?lastNotificationId=${lastNotificationId}`;
|
|
||||||
const data = await fetch(url).then((res) => res.json());
|
const data = await fetch(url).then((res) => res.json());
|
||||||
|
|
||||||
return data?.notifications || [];
|
return data?.notifications || [];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return Promise.reject('Error while fetching notifications!', error);
|
return Promise.reject('Error while fetching notifications!', error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user