From bf7a7834b4baf1455ab6d0e10512df4e3b5fdeba Mon Sep 17 00:00:00 2001 From: gferraro Date: Tue, 20 Jul 2021 15:40:30 +1200 Subject: [PATCH] add track tag to type --- api/V1/recordingUtil.ts | 2 +- models/Track.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/V1/recordingUtil.ts b/api/V1/recordingUtil.ts index 9d5747a1..b0b14232 100644 --- a/api/V1/recordingUtil.ts +++ b/api/V1/recordingUtil.ts @@ -1166,7 +1166,7 @@ async function sendAlerts(recID: number) { let matchedTrack, matchedTag; // find any ai master tags that match the visit tag for (const track of recording.Tracks) { - matchedTag = (track as any).TrackTags.find( + matchedTag = track.TrackTags.find( (tag) => tag.data == AI_MASTER && recVisit.what == tag.what ); if (matchedTag) { diff --git a/models/Track.ts b/models/Track.ts index 4f513897..aab8624a 100644 --- a/models/Track.ts +++ b/models/Track.ts @@ -37,6 +37,8 @@ export interface Track extends Sequelize.Model, ModelCommon { ) => Promise; // NOTE: Implicitly created by sequelize associations. getRecording: () => Promise; + + TrackTags?: TrackTag[]; } export interface TrackStatic extends ModelStaticCommon { replaceTag: (id: TrackId, tag: TrackTag) => Promise;