Skip to content

Commit

Permalink
Refactor Realtime class; replace BadDataException with no-op for miss…
Browse files Browse the repository at this point in the history
…ing tenantId
  • Loading branch information
simlarsen committed Sep 27, 2024
1 parent d48b725 commit 299707f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Common/UI/Utils/Realtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import SocketIO, { Socket } from "socket.io-client";
import ModelEventType from "../../Types/Realtime/ModelEventType";
import ListenToModelEventJSON from "../../Types/Realtime/ListenToModelEventJSON";
import EventName from "../../Types/Realtime/EventName";
import BadDataException from "../../Types/Exception/BadDataException";

export interface ListenToModelEvent<
Model extends AnalyticsBaseModel | BaseModel,
Expand Down Expand Up @@ -44,9 +43,9 @@ export default abstract class Realtime {
}

if (!listenToModelEvent.tenantId) {
throw new BadDataException(
"TenantId is required to listen to model event.",
);
return (): void => {
// Do nothing.
};
}

const listenToModelEventJSON: ListenToModelEventJSON = {
Expand Down

0 comments on commit 299707f

Please sign in to comment.