From bfc63a9236c05cca0f7b05e49f7ede3b45a5ef6d Mon Sep 17 00:00:00 2001 From: Joshua Kitenge <83226114+joshuadkitenge@users.noreply.github.com> Date: Mon, 14 Aug 2023 13:22:12 +0100 Subject: [PATCH] DSEGOG-132 --- src/api/sessions.test.tsx | 2 +- src/api/sessions.tsx | 2 +- src/app.types.tsx | 2 +- .../sessionDrawer.component.test.tsx.snap | 24 ++--- .../deleteSessionDialogue.component.test.tsx | 6 +- .../deleteSessionDialogue.component.tsx | 8 +- .../sessionDialogue.component.test.tsx | 5 + src/session/sessionDialogue.component.tsx | 8 +- src/session/sessionDrawer.component.test.tsx | 5 +- src/session/sessionDrawer.component.tsx | 17 +++- .../sessionSaveButtons.component.test.tsx | 99 ++++++++++++------- src/session/sessionSaveButtons.component.tsx | 32 ++++-- src/views/viewTabs.component.tsx | 20 +++- 13 files changed, 157 insertions(+), 73 deletions(-) diff --git a/src/api/sessions.test.tsx b/src/api/sessions.test.tsx index 03ad384e6..20a95af63 100644 --- a/src/api/sessions.test.tsx +++ b/src/api/sessions.test.tsx @@ -16,7 +16,7 @@ describe('session api functions', () => { mockData = { name: 'test', summary: 'test', - session_data: {}, + session: {}, auto_saved: false, _id: '1', }; diff --git a/src/api/sessions.tsx b/src/api/sessions.tsx index 8915d5916..1eebf7099 100644 --- a/src/api/sessions.tsx +++ b/src/api/sessions.tsx @@ -17,7 +17,7 @@ const saveSession = (apiUrl: string, session: Session): Promise => { queryParams.append('auto_saved', session.auto_saved.toString()); return axios - .post(`${apiUrl}/sessions`, session.session_data, { + .post(`${apiUrl}/sessions`, session.session, { params: queryParams, headers: { Authorization: `Bearer ${readSciGatewayToken()}`, diff --git a/src/app.types.tsx b/src/app.types.tsx index 074b1fe32..9ab06017c 100644 --- a/src/app.types.tsx +++ b/src/app.types.tsx @@ -234,7 +234,7 @@ export interface Session { name: string; summary: string; auto_saved: boolean; - session_data: ImportSessionType; + session: ImportSessionType; } export interface SessionResponse { diff --git a/src/session/__snapshots__/sessionDrawer.component.test.tsx.snap b/src/session/__snapshots__/sessionDrawer.component.test.tsx.snap index 793a14612..0bcd7c3f9 100644 --- a/src/session/__snapshots__/sessionDrawer.component.test.tsx.snap +++ b/src/session/__snapshots__/sessionDrawer.component.test.tsx.snap @@ -64,14 +64,14 @@ exports[`session Drawer renders correctly 1`] = ` - Session 1 + Session 3