- {formatFullDateTimeWithLocale(item.created, location.locale)}
+ {formatFullDateTimeWithLocale(item.createdAt, location.locale)}
|
{item.username} |
- {item.priviliges[0]} |
+ {item.type} |
-
+
|
{hasPermission('ADMIN') ? (
@@ -59,7 +58,7 @@ function ApiKeyList({ location, fetchApiKeys, removeKey, addKey, keys, hasPermis
href=""
onClick={e => {
e.preventDefault();
- deleteKey(item.key);
+ deleteKey(item.secret);
}}
>
@@ -82,7 +81,7 @@ ApiKeyList.propTypes = {
fetchApiKeys: PropTypes.func.isRequired,
removeKey: PropTypes.func.isRequired,
addKey: PropTypes.func.isRequired,
- keys: PropTypes.object.isRequired,
+ keys: PropTypes.array.isRequired,
hasPermission: PropTypes.func.isRequired,
};
diff --git a/frontend/src/store/e-api-admin/actions.js b/frontend/src/store/e-api-admin/actions.js
index a278e43cd8..2135ae8f36 100644
--- a/frontend/src/store/e-api-admin/actions.js
+++ b/frontend/src/store/e-api-admin/actions.js
@@ -17,17 +17,17 @@ export function fetchApiKeys() {
.then(value =>
dispatch({
type: RECIEVE_KEYS,
- keys: value,
+ tokens: value.tokens,
})
)
.catch(dispatchAndThrow(dispatch, ERROR_FETCH_KEYS));
}
-export function removeKey(key) {
+export function removeKey(secret) {
return dispatch =>
api
- .remove(key)
- .then(() => dispatch({ type: REMOVE_KEY, key }))
+ .remove(secret)
+ .then(() => dispatch({ type: REMOVE_KEY, secret }))
.catch(dispatchAndThrow(dispatch, REMOVE_KEY));
}
diff --git a/frontend/src/store/e-api-admin/index.js b/frontend/src/store/e-api-admin/index.js
index 5f06ff29bd..8a526b23cf 100644
--- a/frontend/src/store/e-api-admin/index.js
+++ b/frontend/src/store/e-api-admin/index.js
@@ -4,11 +4,11 @@ import { RECIEVE_KEYS, ADD_KEY, REMOVE_KEY } from './actions';
const store = (state = new List(), action) => {
switch (action.type) {
case RECIEVE_KEYS:
- return new List(action.keys);
+ return new List(action.tokens);
case ADD_KEY:
return state.push(action.token);
case REMOVE_KEY:
- return state.filter(v => v.key !== action.key);
+ return state.filter(v => v.secret !== action.secret);
default:
return state;
}
|