Skip to content

Commit

Permalink
Merge pull request #623 from noms-digital-studio/LIC-729-update-com-r…
Browse files Browse the repository at this point in the history
…elationship

Use RO instead of COM
  • Loading branch information
atodd-noms authored Nov 6, 2018
2 parents 1b5a934 + edd2461 commit 1487c48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions server/data/nomisClientBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = token => {

getComRelation: function(bookingId) {
const path = `${apiUrl}/bookings/${bookingId}/relationships`;
const query = {relationshipType: 'COM'};
const query = {relationshipType: 'RO'};
return nomisGet({path, query});
},

Expand Down Expand Up @@ -93,7 +93,7 @@ module.exports = token => {
},

getROPrisoners: function(deliusUserName) {
const path = `${apiUrl}/offender-relationships/externalRef/${deliusUserName}/COM`;
const path = `${apiUrl}/offender-relationships/externalRef/${deliusUserName}/RO`;
return nomisGet({path});
},

Expand Down
6 changes: 3 additions & 3 deletions test/data/nomisClientTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,15 @@ describe('nomisClient', function() {

it('should return data from api', () => {
fakeNomis
.get(`/bookings/1/relationships?relationshipType=COM`)
.get(`/bookings/1/relationships?relationshipType=RO`)
.reply(200, {key: 'value'});

return expect(nomisClient.getComRelation('1')).to.eventually.eql({key: 'value'});
});

it('should reject if api fails', () => {
fakeNomis
.get(`/bookings/1/relationships?query=relationshipType%3Aeq%3A%27COM%27`)
.get(`/bookings/1/relationships?query=relationshipType%3Aeq%3A%27RO%27`)
.reply(500);

return expect(nomisClient.getComRelation('1')).to.be.rejected();
Expand All @@ -347,7 +347,7 @@ describe('nomisClient', function() {

describe('getROPrisoners', () => {

const url = '/offender-relationships/externalRef/1/COM';
const url = '/offender-relationships/externalRef/1/RO';

it('should return data from api', () => {
fakeNomis
Expand Down

0 comments on commit 1487c48

Please sign in to comment.