Skip to content

Commit

Permalink
fix(admin-ui): fix attribute api change for users
Browse files Browse the repository at this point in the history
  • Loading branch information
mjatin-dev committed Sep 7, 2022
1 parent 2b6c951 commit 2f4a9a9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions admin-ui/plugins/schema/redux/api/AttributeApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class AttributeApi {
// Get all attributes
getAllAttributes = (opts) => {
return new Promise((resolve, reject) => {
this.api.getAttributes(opts, (error, data) => {
this.api.getAllAttribute(opts, (error, data) => {
handleResponse(error, reject, resolve, data)
})
})
Expand All @@ -17,7 +17,7 @@ export default class AttributeApi {
// search attributes
searchAttributes = (opts) => {
return new Promise((resolve, reject) => {
this.api.getAttributes(opts, (error, data) => {
this.api.getAllAttribute(opts, (error, data) => {
handleResponse(error, reject, resolve, data)
})
})
Expand Down
8 changes: 6 additions & 2 deletions admin-ui/plugins/schema/redux/reducers/AttributeReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ const INIT_STATE = {
items: [],
item: {},
loading: false,
totalItems: 0,
entriesCount: 0,
}

const reducerName = 'attributeReducer';
const reducerName = 'attributeReducer'

export default function attributeReducer(state = INIT_STATE, action) {
switch (action.type) {
Expand All @@ -36,7 +38,9 @@ export default function attributeReducer(state = INIT_STATE, action) {
if (action.payload.data) {
return {
...state,
items: action.payload.data,
items: action.payload.data.data,
totalItems: action.payload.data.totalItems,
entriesCount: action.payload.data.entriesCount,
loading: false,
}
} else {
Expand Down
5 changes: 1 addition & 4 deletions admin-ui/plugins/schema/redux/sagas/AttributeSaga.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { call, all, put, fork, takeLatest, select } from 'redux-saga/effects'
import {
isFourZeroOneError,
addAdditionalData,
} from 'Utils/TokenController'
import { isFourZeroOneError, addAdditionalData } from 'Utils/TokenController'
import {
getAttributesResponse,
addAttributeResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function UserList(props) {
const dispatch = useDispatch()
const opt = {}
useEffect(() => {
opt['limit'] = 0
opt['limit'] = 100
dispatch(getUsers({}))
dispatch(getAttributes(opt))
dispatch(getRoles())
Expand Down

0 comments on commit 2f4a9a9

Please sign in to comment.