Skip to content

Commit

Permalink
Fix data fetching on badge page
Browse files Browse the repository at this point in the history
  • Loading branch information
vgeorge committed Dec 23, 2022
1 parent a433b73 commit d5bd43b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/pages/organizations/[id]/badges/[badgeId]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,15 @@ export default class EditBadge extends Component {
async loadData() {
const { orgId, badgeId } = this.props
try {
const [org, badge, { members }, { managers, owners }] = await Promise.all(
[
const [org, badge, { data: members }, { data: staff }] =
await Promise.all([
getOrg(orgId),
apiClient.get(`/organizations/${orgId}/badges/${badgeId}`),
apiClient.get(`/organizations/${orgId}/members`),
apiClient.get(`/organizations/${orgId}/staff`),
]
)
])

const assignablePeople = members.concat(managers).concat(owners)
const assignablePeople = members.concat(staff)

this.setState({
org,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/organizations/[id]/badges/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getRandomColor } from '../../../../lib/utils'
import { toast } from 'react-toastify'
import logger from '../../../../lib/logger'

const URL = process.APP_URL
const URL = process.env.APP_URL

const apiClient = new APIClient()

Expand Down

0 comments on commit d5bd43b

Please sign in to comment.