panoratech / Panora

Add an integration catalog to your SaaS product in minutes
https://docs.panora.dev
Apache License 2.0
375 stars 76 forks source link

Not getting list of applications in magic link #488

Closed arkanoid17 closed 3 weeks ago

arkanoid17 commented 4 weeks ago

Hi, I have been trying to create a magic link to create a CRM integration but after the link is generated no applications are showing up as can bee seen in the screenshot below.

Screenshot 2024-06-06 at 6 30 23 PM

Also I keep getting this issue in the terminal saying

err: { api-1 | "type": "NotFoundException", api-1 | "message": "Connectors not found for current project!", api-1 | "stack": api-1 | NotFoundException: Connectors not found for current project! api-1 | at ProjectConnectorsService.getConnectorsByProjectId (/app/packages/api/dist/src/@core/project-connectors/project-connectors.service.js:91:23) api-1 | at async ProjectConnectorsController.getConnectorsFromProject (/app/packages/api/dist/src/@core/project-connectors/project-connectors.controller.js:39:16) api-1 | "response": { api-1 | "type": "Object", api-1 | "message": "Connectors not found for current project!", api-1 | "stack": api-1 | api-1 | "error": "Not Found", api-1 | "statusCode": 404 api-1 | }, api-1 | "status": 404, api-1 | "options": {}, api-1 | "name": "NotFoundException" api-1 | } api-1 | Req data is: { api-1 | id_user: '5de5e7f2-aee8-4114-b7e3-a1dc5e67e87a', api-1 | email: 'arkaprabha.mahata@adjoint.in', api-1 | first_name: 'Arkaprabha', api-1 | last_name: 'Mahata', api-1 | id_project: 'acb1a3a8-f868-42c4-9040-68db6be5057f' api-1 | }

It would be very helpful if you can resolve this quickly. Thnak you again

greptile-apps[bot] commented 4 weeks ago

This help was generated by greptile.com

To resolve the issue of not getting the list of applications in the magic link, follow these steps:

  1. Check Database Entries: Ensure that the project_connectors table has entries for the given id_project (acb1a3a8-f868-42c4-9040-68db6be5057f). The error indicates that no connectors are found for the project.

  2. Service Method: Verify the getConnectorsByProjectId method in project-connectors.service.ts to ensure it correctly queries the database:

async getConnectorsByProjectId(id_project: string) {
  try {
    const project = await this.prisma.projects.findFirst({
      where: { id_project },
    });

    if (!project) {
      throw new NotFoundException('Project does not exist!');
    }

    const res = await this.prisma.project_connectors.findFirst({
      where: { id_project: id_project },
    });
    if (!res) {
      throw new NotFoundException('Connectors not found for current project!');
    }
    return res;
  } catch (error) {
    handleServiceError(error, this.logger);
  }
}
  1. Controller Method: Ensure the getConnectorsFromProject method in project-connectors.controller.ts correctly calls the service method:
@Get()
async getConnectorsFromProject(@Query('projectId') id: string) {
  return await this.projectConnectorsService.getConnectorsByProjectId(id);
}
  1. Frontend Hook: Verify the useProjectConnectors hook in useProjectConnectors.tsx to ensure it correctly fetches data from the API:
const useProjectConnectors = (id: string) => {
  return useQuery({
    queryKey: ['project-connectors', id], 
    queryFn: async (): Promise<any> => {
      const response = await fetch(`${config.API_URL}/project-connectors?projectId=${id}`);
      if (!response.ok) {
        throw new Error('Network response was not ok');
      }
      return response.json();
    }
  });
};
export default useProjectConnectors;

Ensure that the API URL is correct and the project ID is being passed correctly.

References

/packages/api/src/@core/project-connectors/project-connectors.service.ts /packages/api/src/@core/project-connectors/project-connectors.controller.ts /apps/magic-link/src/hooks/queries/useProjectConnectors.tsx /apps/magic-link/src/hooks/queries /packages/api/src/@core/project-connectors

Ask Greptile

naelob commented 4 weeks ago

Hi, I have been trying to create a magic link to create a CRM integration but after the link is generated no applications are showing up as can bee seen in the screenshot below.

Screenshot 2024-06-06 at 6 30 23 PM

Also I keep getting this issue in the terminal saying

err: { api-1 | "type": "NotFoundException", api-1 | "message": "Connectors not found for current project!", api-1 | "stack": api-1 | NotFoundException: Connectors not found for current project! api-1 | at ProjectConnectorsService.getConnectorsByProjectId (/app/packages/api/dist/src/@core/project-connectors/project-connectors.service.js:91:23) api-1 | at async ProjectConnectorsController.getConnectorsFromProject (/app/packages/api/dist/src/@core/project-connectors/project-connectors.controller.js:39:16) api-1 | "response": { api-1 | "type": "Object", api-1 | "message": "Connectors not found for current project!", api-1 | "stack": api-1 | api-1 | "error": "Not Found", api-1 | "statusCode": 404 api-1 | }, api-1 | "status": 404, api-1 | "options": {}, api-1 | "name": "NotFoundException" api-1 | } api-1 | Req data is: { api-1 | id_user: '5de5e7f2-aee8-4114-b7e3-a1dc5e67e87a', api-1 | email: 'arkaprabha.mahata@adjoint.in', api-1 | first_name: 'Arkaprabha', api-1 | last_name: 'Mahata', api-1 | id_project: 'acb1a3a8-f868-42c4-9040-68db6be5057f' api-1 | }

It would be very helpful if you can resolve this quickly. Thnak you again

I just merged a PR

Hi, I have been trying to create a magic link to create a CRM integration but after the link is generated no applications are showing up as can bee seen in the screenshot below.

Screenshot 2024-06-06 at 6 30 23 PM

Also I keep getting this issue in the terminal saying

err: { api-1 | "type": "NotFoundException", api-1 | "message": "Connectors not found for current project!", api-1 | "stack": api-1 | NotFoundException: Connectors not found for current project! api-1 | at ProjectConnectorsService.getConnectorsByProjectId (/app/packages/api/dist/src/@core/project-connectors/project-connectors.service.js:91:23) api-1 | at async ProjectConnectorsController.getConnectorsFromProject (/app/packages/api/dist/src/@core/project-connectors/project-connectors.controller.js:39:16) api-1 | "response": { api-1 | "type": "Object", api-1 | "message": "Connectors not found for current project!", api-1 | "stack": api-1 | api-1 | "error": "Not Found", api-1 | "statusCode": 404 api-1 | }, api-1 | "status": 404, api-1 | "options": {}, api-1 | "name": "NotFoundException" api-1 | } api-1 | Req data is: { api-1 | id_user: '5de5e7f2-aee8-4114-b7e3-a1dc5e67e87a', api-1 | email: 'arkaprabha.mahata@adjoint.in', api-1 | first_name: 'Arkaprabha', api-1 | last_name: 'Mahata', api-1 | id_project: 'acb1a3a8-f868-42c4-9040-68db6be5057f' api-1 | }

It would be very helpful if you can resolve this quickly. Thnak you again

When did you try to do it ? Because I merged a PR fixing this issue 30min ago

mit-27 commented 4 weeks ago

Hi, I have been trying to create a magic link to create a CRM integration but after the link is generated no applications are showing up as can bee seen in the screenshot below.

Screenshot 2024-06-06 at 6 30 23 PM

Also I keep getting this issue in the terminal saying err: { api-1 | "type": "NotFoundException", api-1 | "message": "Connectors not found for current project!", api-1 | "stack": api-1 | NotFoundException: Connectors not found for current project! api-1 | at ProjectConnectorsService.getConnectorsByProjectId (/app/packages/api/dist/src/@core/project-connectors/project-connectors.service.js:91:23) api-1 | at async ProjectConnectorsController.getConnectorsFromProject (/app/packages/api/dist/src/@core/project-connectors/project-connectors.controller.js:39:16) api-1 | "response": { api-1 | "type": "Object", api-1 | "message": "Connectors not found for current project!", api-1 | "stack": api-1 | api-1 | "error": "Not Found", api-1 | "statusCode": 404 api-1 | }, api-1 | "status": 404, api-1 | "options": {}, api-1 | "name": "NotFoundException" api-1 | } api-1 | Req data is: { api-1 | id_user: '5de5e7f2-aee8-4114-b7e3-a1dc5e67e87a', api-1 | email: 'arkaprabha.mahata@adjoint.in', api-1 | first_name: 'Arkaprabha', api-1 | last_name: 'Mahata', api-1 | id_project: 'acb1a3a8-f868-42c4-9040-68db6be5057f' api-1 | } It would be very helpful if you can resolve this quickly. Thnak you again

I just merged a PR

Hi, I have been trying to create a magic link to create a CRM integration but after the link is generated no applications are showing up as can bee seen in the screenshot below.

Screenshot 2024-06-06 at 6 30 23 PM

Also I keep getting this issue in the terminal saying err: { api-1 | "type": "NotFoundException", api-1 | "message": "Connectors not found for current project!", api-1 | "stack": api-1 | NotFoundException: Connectors not found for current project! api-1 | at ProjectConnectorsService.getConnectorsByProjectId (/app/packages/api/dist/src/@core/project-connectors/project-connectors.service.js:91:23) api-1 | at async ProjectConnectorsController.getConnectorsFromProject (/app/packages/api/dist/src/@core/project-connectors/project-connectors.controller.js:39:16) api-1 | "response": { api-1 | "type": "Object", api-1 | "message": "Connectors not found for current project!", api-1 | "stack": api-1 | api-1 | "error": "Not Found", api-1 | "statusCode": 404 api-1 | }, api-1 | "status": 404, api-1 | "options": {}, api-1 | "name": "NotFoundException" api-1 | } api-1 | Req data is: { api-1 | id_user: '5de5e7f2-aee8-4114-b7e3-a1dc5e67e87a', api-1 | email: 'arkaprabha.mahata@adjoint.in', api-1 | first_name: 'Arkaprabha', api-1 | last_name: 'Mahata', api-1 | id_project: 'acb1a3a8-f868-42c4-9040-68db6be5057f' api-1 | } It would be very helpful if you can resolve this quickly. Thnak you again

When did you try to do it? Because I merged a PR fixing this issue 30min ago

Hello @arkanoid17, please use the given credentials for login. The issue will be resolved for these credentials.

Email - local@panora.dev Password - panora123

greptile-apps[bot] commented 3 weeks ago

This help was generated by greptile.com

Check the getConnectorsByProjectId method in packages/api/src/@core/project-connectors/project-connectors.service.ts to ensure the project ID is correct. Verify the useProjectConnectors hooks in apps/magic-link/src/hooks/queries/useProjectConnectors.tsx, apps/client-ts/src/hooks/get/useProjectConnectors.tsx, and apps/embedded-catalog/react/src/hooks/queries/useProjectConnectors.tsx to ensure they are querying the API correctly.

References

/packages/api/src/@core/project-connectors/project-connectors.service.ts /packages/api/src/@core/project-connectors/project-connectors.controller.ts /apps/magic-link/src/hooks/queries/useProjectConnectors.tsx /apps/client-ts/src/hooks/get/useProjectConnectors.tsx /apps/embedded-catalog/react/src/hooks/queries/useProjectConnectors.tsx /apps/magic-link/src/hooks/queries /packages/api/src/@core/project-connectors

Ask Greptile

naelob commented 3 weeks ago

Fixed with the new PR merged