From cf5fc3d9aa8a533499bbcc8bce27589e8eb8c069 Mon Sep 17 00:00:00 2001 From: Dave MacFarlane Date: Tue, 8 Aug 2023 09:19:55 -0400 Subject: [PATCH] make version check a switch --- modules/api/php/views/project.class.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/api/php/views/project.class.inc b/modules/api/php/views/project.class.inc index 5ae07adb325..d64a3056362 100644 --- a/modules/api/php/views/project.class.inc +++ b/modules/api/php/views/project.class.inc @@ -58,7 +58,11 @@ class Project 'Instruments' => array_keys(\Utility::getAllInstruments()), 'Visits' => $this->_getVisits(), ]; - if ($this->apiversion == 'v0.0.4-dev') { + switch($this->apiversion) { + case 'v0.0.3': + return $obj; + default: + // >= v0.0.4 $obj['Cohorts'] = array_map( function ($cohort) { return $cohort['title'];