File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1- import React from 'react'
1+ import React , { useEffect } from 'react'
22// import { Route } from 'react-router-dom'
33import PropTypes from 'prop-types'
4+ import api from '../_api'
45
56const Administration = ( { match } ) => {
7+ useEffect ( ( ) => {
8+ api . users . getList ( ) . then ( res => console . log ( 'res' , res ) )
9+ } , [ ] )
10+
611 return (
712 < div >
813 { /* <Route path={`${match.path}/login` } component={Login} /> */ }
Original file line number Diff line number Diff line change 11import instance from './client'
2- // import mocks from './_mocks'
2+ import mocks from './_mocks'
33import organizations from './organizations'
44import users from './users'
55
@@ -8,6 +8,12 @@ export interface ApiInitOptions {
88}
99
1010const init = ( options : ApiInitOptions = { } ) => {
11+ // const mockAdapter = options.useSampleData ? mocks.init(instance) : undefined
12+
13+ if ( options . useSampleData ) {
14+ mocks . init ( instance )
15+ }
16+
1117 return instance
1218}
1319
You can’t perform that action at this time.
0 commit comments