Skip to content

Commit

Permalink
frontend - fix customers list loading
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpochat committed Mar 12, 2024
1 parent ccfe7f1 commit 4088675
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/app/src/domains/customer/CustomerController.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function CustomerController({producer: producer}) {

function getContent() {
switch (currentAction) {
case 'NONE': return <CustomersList/>
case 'NONE': return <CustomersList producer={producer}/>
}
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/app/src/domains/customer/views/CustomersList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useKeycloak } from '@react-keycloak/web'
import { ApiBuilder } from '../../../api/ApiBuilder.ts'
import { ApiInvoker } from '../../../api/ApiInvoker.ts';

export default function CustomersList() {
export default function CustomersList({producer: producer}) {

const [customers, setCustomers] = useState([])
const { keycloak, initialized } = useKeycloak()
Expand All @@ -19,7 +19,7 @@ export default function CustomersList() {

function loadCustomers() {

apiInvoker.callApiAuthenticatedly(keycloak, api => api.getProducerCustomers, null, setCustomers, console.error)
apiInvoker.callApiAuthenticatedly(keycloak, api => api.getProducerCustomers, producer.id, setCustomers, console.error)

// apiBuilder.getAuthenticatedApi(keycloak).then(api => {
// apiBuilder.invokeAuthenticatedApi(() => {
Expand Down

0 comments on commit 4088675

Please sign in to comment.