diff --git a/src/app-bundles/explore-data-bundle.js b/src/app-bundles/explore-data-bundle.js index 45fe8062..b4c49d29 100644 --- a/src/app-bundles/explore-data-bundle.js +++ b/src/app-bundles/explore-data-bundle.js @@ -1,5 +1,6 @@ import { createSelector } from 'redux-bundler'; +import { getToken } from '../userService.ts'; import { seriesStyles } from '../common/helpers/utils'; const exploreDataBundle = { @@ -65,14 +66,13 @@ const exploreDataBundle = { dispatch({ type: 'EXPLORE_DATA_LOADING', payload: true }); const apiRoot = store.selectApiRoot(); - const token = store.selectAuthTokenRaw(); await fetch(`${apiRoot}/explorer?before=${before}&after=${after}`, { method: 'POST', mode: 'cors', headers: { 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + token, + 'Authorization': 'Bearer ' + getToken(), }, body: JSON.stringify(instrumentIds), }) @@ -89,7 +89,7 @@ const exploreDataBundle = { mode: 'cors', headers: { 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + token, + 'Authorization': 'Bearer ' + getToken(), }, body: JSON.stringify(instrumentIds), }) diff --git a/src/app-pages/instrument/notes.jsx b/src/app-pages/instrument/notes.jsx index bfeedf5b..3dcd2a49 100644 --- a/src/app-pages/instrument/notes.jsx +++ b/src/app-pages/instrument/notes.jsx @@ -105,22 +105,22 @@ const NoteItem = ({ note, editable, save }) => { }; export default connect( + 'selectProfileActive', 'selectProjectsByRoute', 'selectInstrumentNotesItems', - 'selectAuthEdipi', 'doInstrumentNotesSave', 'doInstrumentNotesDelete', ({ + profileActive, projectsByRoute: project, instrumentNotesItems: notes, - authEdipi, doInstrumentNotesSave: save, doInstrumentNotesDelete: del, }) => { const [isAdding, setIsAdding] = useState(false); - const edipi = Number(authEdipi); const sorted = notes.sort(); + const { id } = profileActive; return ( project && ( @@ -133,7 +133,7 @@ export default connect( note={note} save={save} del={del} - editable={edipi === note.creator_id} + editable={id === note.creator_id} /> )) : No Notes Added}