@@ -49,7 +49,7 @@ export async function updateMonitor(
orgId: string,
monitorSlug: string,
data: Partial<Monitor>
-) {
+): Promise<Monitor | null> {
addLoadingMessage();
try {
@@ -44,7 +44,10 @@ function MonitorHeaderActions({monitor, orgId, onUpdate}: Props) {
const handleUpdate = async (data: Partial<Monitor>) => {
const resp = await updateMonitor(api, orgId, monitor.slug, data);
- onUpdate?.(resp);
+
+ if (resp !== null) {
+ onUpdate?.(resp);
+ }
};
const toggleMute = () => handleUpdate({isMuted: !monitor.isMuted});
@@ -81,7 +81,10 @@ function MonitorDetails({params, location}: Props) {
return;
}
const resp = await updateMonitor(api, organization.slug, monitor.slug, data);
- onUpdate(resp);
+ onUpdate(resp);
if (!monitor) {