From 54c14968068c1103a0f3eafe52977c762ef57665 Mon Sep 17 00:00:00 2001 From: dmeidlin <14339308+dmeidlin@users.noreply.github.com> Date: Thu, 17 Jun 2021 14:17:29 -0400 Subject: [PATCH] [BI-750] fix TS issues --- src/breeding-insight/service/TrialService.ts | 2 +- src/views/trials-and-studies/StudiesList.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/breeding-insight/service/TrialService.ts b/src/breeding-insight/service/TrialService.ts index 393bd5400..6305ebfab 100644 --- a/src/breeding-insight/service/TrialService.ts +++ b/src/breeding-insight/service/TrialService.ts @@ -64,7 +64,7 @@ export class TrialService { } - static async getById(programId: string, trialId: string): Promise> { + static async getById(programId?: string, trialId?: string): Promise> { try { if(!programId) throw new Error('missing or invalid program id'); if(!trialId) throw new Error('missing or invalid trial id'); diff --git a/src/views/trials-and-studies/StudiesList.vue b/src/views/trials-and-studies/StudiesList.vue index 8bd294251..65ed34ae5 100644 --- a/src/views/trials-and-studies/StudiesList.vue +++ b/src/views/trials-and-studies/StudiesList.vue @@ -51,7 +51,7 @@ export default class StudiesList extends ProgramsBase { private trial: Trial = new Trial(); private activeProgram?: Program; - private trialId: string | undefined = this.$route.params.trialId; + private trialId?: string = this.$route.params.trialId; private title: string = 'All Studies'; mounted() { @@ -60,7 +60,7 @@ async getTrial() { try { - const response: Result = await TrialService.getById(this.activeProgram.id!, this.trialId!); + const response: Result = await TrialService.getById(this.activeProgram!.id, this.trialId!); if(response.isErr()) throw response.value; this.trial = response.value; this.title = `Studies in ${this.trial.trialName}`;