# Routing not working for audit trail issue

**URL:** <https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544>\
**Category:** GSOC\
**Created:** [March 11, 2024, 1:28pm UTC](https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544 "2024-03-11T13:28:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lovelyfin00](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/lovelyfin00/32/274_2.png) [@Lovelyfin00](https://talk.openelis-global.org/u/Lovelyfin00)\
**Post date:** [March 11, 2024, 1:28pm UTC](https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544/1 "2024-03-11T13:28:18Z")

</div>

Hi everyone  
I’m working on [this issue](https://github.com/I-TECH-UW/OpenELIS-Global-2/issues/761), In the `routine.js` and `study.js`, the routing of the auditTrailReport was written as

```auto
{
      title: <FormattedMessage id="sideNav.title.audittrail"/>,
      icon: IbmWatsonNaturalLanguageUnderstanding,
      SideNavMenuItem: [
        {
          link: config.serverBaseUrl + "/AuditTrailReport",
          label: <FormattedMessage id="sideNav.label.audittrail"/>,
        },
      ],
    },

```

And I changed the routing to the component I just created

```auto
{
      title: <FormattedMessage id="sideNav.title.audittrail"/>,
      icon: IbmWatsonNaturalLanguageUnderstanding,
      SideNavMenuItem: [
        {
          link: "/AuditTrailReport",
          label: <FormattedMessage id="sideNav.label.audittrail"/>,
        },
      ],
    },

```

When I click on `auditTrail` in the sidemenu, it redirects me to `https://localhost/api/OpenELIS-Global/AuditTrailReport` when its supposed to redirect me `https://localhost/AuditTrailReport`

Has anyone experienced this before?  
I’d love some help with this please. And also if anybody has a correct `lab no` that I can use for testing purposes, that would be awesome.

---

<div class="post-metadata">

**Author:** ![mherman22](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mherman22/32/92_2.png) [@mherman22](https://talk.openelis-global.org/u/mherman22)\
**Post date:** [March 11, 2024, 2:51pm UTC](https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544/2 "2024-03-11T14:51:46Z")

</div>

So we have audit trail in both `RoutineReports` and `StudyReports` and could be where the confusion is coming from.

So ideally you would need to go to the [routine.js](https://github.com/I-TECH-UW/OpenELIS-Global-2/blob/581e2fdfa93911db7d7c2dd04ae493dcdc54cab7/frontend/src/components/Reports/Routine.js#L123-L131) and make the required change not forgetting that your url should be something like `/RoutineReport/AuditTrailReport` by doing other necessary changes in **Reports/routine/index.js**

And then do the same in [study.js](https://github.com/I-TECH-UW/OpenELIS-Global-2/blob/581e2fdfa93911db7d7c2dd04ae493dcdc54cab7/frontend/src/components/Reports/Study.js#L204-L213) but don’t forget something like `/StudyReport/AuditTrailReport` after making other necessary changes aswell in **Reports/study/index.js** (this you will have to create).

**or** you could share a draft pr link for better guidance!

---

<div class="post-metadata">

**Author:** ![Lovelyfin00](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/lovelyfin00/32/274_2.png) [@Lovelyfin00](https://talk.openelis-global.org/u/Lovelyfin00)\
**Post date:** [March 11, 2024, 3:59pm UTC](https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544/3 "2024-03-11T15:59:32Z")

</div>

I get the same issue

> **[11.03.2024\_16.57.31\_REC](https://screenrec.com/share/DrtivIYLKs)**
>
> Recorded with ScreenRec

I’ll open a draft PR now and share the link

This is the link to draft PR

> <https://github.com/I-TECH-UW/OpenELIS-Global-2/pull/791>
>
> Fixes #761 
> 
> Fixes #767 
> 
> \## Fix Summary
> Still a work in progress but going… to migrate the \`Audit Trail report\` from JSP to new React UI

---

<div class="post-metadata">

**Author:** ![Manish](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/manish/32/472_2.png) [@Manish](https://talk.openelis-global.org/u/Manish)\
**Post date:** [March 11, 2024, 4:20pm UTC](https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544/4 "2024-03-11T16:20:06Z")

</div>

Hey @Lovelyfin00 create a route for `/AuditTrailReport` in app.js then it will work! In the draft PR i see you have not created the one!

---

<div class="post-metadata">

**Author:** ![Manish](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/manish/32/472_2.png) [@Manish](https://talk.openelis-global.org/u/Manish)\
**Post date:** [March 11, 2024, 4:22pm UTC](https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544/5 "2024-03-11T16:22:01Z")

</div>

And also For Routine reports as well as for Study reports keep the link as ` link: "/AuditTrailReport",` for the side nav! since both are redirecting to only one page only!

---

<div class="post-metadata">

**Author:** ![Lovelyfin00](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/lovelyfin00/32/274_2.png) [@Lovelyfin00](https://talk.openelis-global.org/u/Lovelyfin00)\
**Post date:** [March 11, 2024, 4:27pm UTC](https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544/6 "2024-03-11T16:27:28Z")

</div>

Ohhhhhh wow  
I’ll do that and test it out  
Thanks

---

<div class="post-metadata">

**Author:** ![Lovelyfin00](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/lovelyfin00/32/274_2.png) [@Lovelyfin00](https://talk.openelis-global.org/u/Lovelyfin00)\
**Post date:** [March 11, 2024, 4:31pm UTC](https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544/7 "2024-03-11T16:31:23Z")

</div>

Works like magic  
Thanks

---

<div class="post-metadata">

**Author:** ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)\
**Post date:** [March 12, 2024, 1:53pm UTC](https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544/8 "2024-03-12T13:53:59Z")

</div>

hello @mherman22 @sharif @Manish  
i request for reviews here , I might be facing similar problem on [issue 760](https://github.com/I-TECH-UW/OpenELIS-Global-2/pull/792/files)

---

<div class="post-metadata">

**Author:** ![Manish](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/manish/32/472_2.png) [@Manish](https://talk.openelis-global.org/u/Manish)\
**Post date:** [March 12, 2024, 2:28pm UTC](https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544/9 "2024-03-12T14:28:06Z")

</div>

Hello, @Agaba_Derrick_Junior, I have mentioned the required changes to the PR. Please take a look!

---

<div class="post-metadata">

**Author:** ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)\
**Post date:** [March 12, 2024, 2:35pm UTC](https://talk.openelis-global.org/t/routing-not-working-for-audit-trail-issue/544/10 "2024-03-12T14:35:33Z")

</div>

hey @Manish sure, thanks i will check it out and resolve it
