We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Replace this logic with reusable hook/util in the repo:
const ccuApi = useApi(); const fieldsToFetch = [ 'id', 'name', 'short_name', 'active_phone_number', 'start_at', ]; const { isDataLoading, data } = ccuApi( '/incidents?fields=id,name,short_name,active_phone_number&limit=200&sort=-start_at', { method: 'GET', params: { fields: fieldsToFetch.join(','), limit: 200, sort: '-start_at', }, }, ); const incidentList = computed(() => data.value?.results); function getIncidentPhoneNumbers(incident) { if (Array.isArray(incident.active_phone_number)) { return incident.active_phone_number .map((number) => formatNationalNumber(String(number))) .join(', '); } return formatNationalNumber(String(incident.active_phone_number)); } function filterNumbers(item) { return item.filter((filterItem) => filterItem.active_phone_number); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Replace this logic with reusable hook/util in the repo:
The text was updated successfully, but these errors were encountered: