Skip to content

Commit

Permalink
#470: Refresh the study after status change, to have the current star…
Browse files Browse the repository at this point in the history
…t/plannedStart/end Date in the UI immediately.
  • Loading branch information
benitsch committed Jun 26, 2024
1 parent 916f0f6 commit 7eed4df
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/views/StudyOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Licensed under the Elastic License 2.0. */
import { useStudyStore } from '../stores/studyStore';
import { useStudyGroupStore } from '../stores/studyGroupStore';
import { StudyStatus } from '../generated-sources/openapi';
import { dateToDateString } from '../utils/dateUtils';
const route = useRoute();
const studyStore = useStudyStore();
Expand All @@ -22,13 +21,8 @@ Licensed under the Elastic License 2.0. */
async function processUpdatedStudyStatus(status: StudyStatus): Promise<void> {
await studyStore.updateStudyStatus(status).then(() => {
if (status === StudyStatus.Active || status === StudyStatus.Preview) {
studyStore.study.start = dateToDateString(new Date());
} else if (status === StudyStatus.Draft) {
studyStore.study.start = undefined;
} else if (status === StudyStatus.Closed) {
studyStore.study.end = dateToDateString(new Date());
}
// To update the start/plannedStart/end Date in the UI immediately
studyStore.getStudy(studyId);
});
}
Expand Down

0 comments on commit 7eed4df

Please sign in to comment.