Skip to content

Commit

Permalink
bugfix/auth-artifacts (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJJackson authored Jul 12, 2024
1 parent dbea288 commit 4c5d51d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/app-bundles/explore-data-bundle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createSelector } from 'redux-bundler';

import { getToken } from '../userService.ts';
import { seriesStyles } from '../common/helpers/utils';

const exploreDataBundle = {
Expand Down Expand Up @@ -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),
})
Expand All @@ -89,7 +89,7 @@ const exploreDataBundle = {
mode: 'cors',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + token,
'Authorization': 'Bearer ' + getToken(),
},
body: JSON.stringify(instrumentIds),
})
Expand Down
8 changes: 4 additions & 4 deletions src/app-pages/instrument/notes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 && (
Expand All @@ -133,7 +133,7 @@ export default connect(
note={note}
save={save}
del={del}
editable={edipi === note.creator_id}
editable={id === note.creator_id}
/>
)) : <span className='m-3'>No Notes Added</span>}
<li className='list-group-item'>
Expand Down

0 comments on commit 4c5d51d

Please sign in to comment.