Skip to content

Commit

Permalink
fix: hard code returns url in the njk
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangoulding committed May 3, 2024
1 parent aa2092c commit b895c74
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions app/presenters/licences/view-licence-returns.presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ function go (returnsData) {

return {
activeTab: 'returns',
returnsUrl: 'return/internal',
returns
}
}

function _formatPurpose (purpose) {
const [firstPurpose] = purpose

return firstPurpose.alias ? firstPurpose.alias : firstPurpose.tertiary.description
}

Expand Down
2 changes: 1 addition & 1 deletion app/views/licences/tabs/returns.njk
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{% for return in returns %}
<tr class="govuk-table__row govuk-body-s">
<th class="govuk-table__cell">
<a href="/{{ returnsUrl }}?returnId={{ return.id }}" class="govuk-link">{{ return.reference }} </a>
<a href="/return/internal?returnId={{ return.id }}" class="govuk-link">{{ return.reference }} </a>
<p class="govuk-body-s"> {{ return.dates }}</p>
</th>
<td class="govuk-table__cell">{{ return.purpose }} <p class="govuk-body-s"> {{ return.description }}</p></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ describe('View Licence returns presenter', () => {

expect(result).to.equal({
activeTab: 'returns',
returnsUrl: 'return/internal',
returns: [
{
id: 'mock-id-1',
Expand Down
2 changes: 0 additions & 2 deletions test/services/licences/view-licence-returns.service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ describe('View Licence service returns', () => {

expect(result).to.equal({
licenceName: 'fake licence',
returnsUrl: 'return/internal',
returns: [],
activeTab: 'returns',
pagination: { page: 1 }
Expand All @@ -53,7 +52,6 @@ describe('View Licence service returns', () => {

function _returnsPresenter () {
return {
returnsUrl: 'return/internal',
returns: [],
activeTab: 'returns'
}
Expand Down

0 comments on commit b895c74

Please sign in to comment.