Skip to content

Commit

Permalink
fix variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sandyVidanes committed Feb 3, 2023
1 parent 0affaed commit 9f95b8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/contracts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ export interface MonitorStateInputData {
timeSinceUpdate: string;
}

export type ReviewRequestType = "LiveReviewEvents";
export type LiveReviewRequestType = "LiveReviewEvents";

export interface MonitorReviewUpdatesPayloadInterface {
ID: ReviewRequestType;
RequestType: string;
ID: LiveReviewRequestType;
RequestType: LiveReviewRequestType;
InputData: MonitorReviewInputData
}

Expand Down
13 changes: 7 additions & 6 deletions src/entities/inceptionLiveReviewPolling.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { MonitorReviewUpdatesPayloadInterface, ReviewDataInterface } from '../contracts';
import { MonitorReviewUpdatesPayloadInterface, ReviewDataInterface, LiveReviewRequestType } from '../contracts';
import * as inception from './inception';
import * as mqtt from './mqtt';

export const polling = async () => {

const liveReviewEvents = 'LiveReviewEvents';

const publishLiveReviewUpdates = (data: ReviewDataInterface) => {
const topic = `inception/event`;
const { Description, MessageCategory, What, Where } = data;
Expand All @@ -17,12 +19,11 @@ export const polling = async () => {
};

let monitorUpdatesPayload: MonitorReviewUpdatesPayloadInterface[];

const initPayload = () => {
monitorUpdatesPayload = [
{
ID: "LiveReviewEvents",
RequestType: "LiveReviewEvents",
ID: liveReviewEvents,
RequestType: liveReviewEvents,
InputData: {
referenceId: null,
referenceTime: null
Expand All @@ -46,8 +47,8 @@ export const polling = async () => {
for( let result of results) {
publishLiveReviewUpdates(result);
newMonitorUpdatesPayload.push({
ID: "LiveReviewEvents",
RequestType: "LiveReviewEvents",
ID: liveReviewEvents,
RequestType: liveReviewEvents,
InputData: {
referenceId: result.ID,
referenceTime: result.WhenTicks
Expand Down

0 comments on commit 9f95b8c

Please sign in to comment.