Skip to content

Commit

Permalink
rm namespace and console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
charmingduchess committed Dec 5, 2024
1 parent 552b722 commit 4741593
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions lib/jsonld_serializers.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class ResourceSerializer extends JsonLdItemSerializer {

ResourceSerializer.getFormattedRecordType = function (recordTypeId) {
return {
'@id': 'recordType:' + recordTypeId,
'@id': recordTypeId,
prefLabel: recordTypes[recordTypeId].label
}
}
Expand Down Expand Up @@ -499,8 +499,7 @@ class AggregationSerializer extends JsonLdItemSerializer {
// Build buildingLocation agg labels from nypl-core:
v.label = locations[v.value]?.label
} else if (field === 'recordType') {
console.log(v)
// Build buildingLocation agg labels from nypl-core:
// Build recordType agg labels from nypl-core:
v.label = recordTypes[v.value]?.label
} else {
v.label = v.value
Expand Down
2 changes: 1 addition & 1 deletion test/resource_serializer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const esResponse = require('./fixtures/item-filter-aggregations.json')
describe('Resource Serializer', () => {
describe('formatRecordType', () => {
it('should format properly', () => {
expect(ResourceSerializer.getFormattedRecordType('a')).to.deep.equal({ '@id': 'recordType:a', prefLabel: 'Book/Text' })
expect(ResourceSerializer.getFormattedRecordType('a')).to.deep.equal({ '@id': 'a', prefLabel: 'Book/Text' })
})
})
describe('.formatItemFilterAggregations()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/resources-responses.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ describe('Test Resources responses', function () {

assert(doc.itemAggregations)

assert.deepEqual(doc.recordType, { '@id': 'recordType:a', prefLabel: 'Book/Text' })
assert.deepEqual(doc.recordType, { '@id': 'a', prefLabel: 'Book/Text' })

done()
})
Expand Down

0 comments on commit 4741593

Please sign in to comment.