Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
Promise returns nothing instead of the data

The issue is that I cannot retrieve data from the Promise, however, I can log it to the console. I need to get the result of 'fetchIntegrationName' function displayed in Breadcrumbs.

type TitleFormatter = (location: { pathname: string }, getState: () => RootState) => Promise<string>;

export interface BreadcrumbItem {
  path: string;
  title: string | TitleFormatter;
  actualPath?: string;
  isRootLink?: boolean;
}

const TTNCClientRef: React.MutableRefObject<any> = createRef();
TTNCClientRef.current = createTTNCClient().getIntegrations();

const fetchIntegrationName = async (): Promise<Integration[]> => {          
  const resp = await TTNCClientRef.current;
  const integrationsList = resp.data.content;
  return integrationsList[0].name
}

export const buildBreadcrumbDefinitions = ({ solutionId, selectedApplication, solutionName }): ImmutableMap<Record<string, BreadcrumbItem>> =>
  Immutable.fromJS({
      devicesRoute: {
        title: i18n.t('devices.management'),
        path: '/devices',
      },
  integration: {
     title: async () => {
      await fetchIntegrationName()
      .then ((data) => {
        console.log(data) // console.logs "Integration apu-test-integration"
        return `Integration ${data}` // returns nothing
      })
    },            
    path: `/devices/integrations/:integrationId/devices`,
  },
} as Record<string, BreadcrumbItem>);

enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!