Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix data fetching on badge page #360

Merged
merged 1 commit into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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