Skip to content

&ai Add partner record handling - #97

Merged
danamansana merged 1 commit into
mainfrom
scc-5447
Aug 17, 2026
Merged

&ai Add partner record handling#97
danamansana merged 1 commit into
mainfrom
scc-5447

Conversation

@danamansana

Copy link
Copy Markdown
Contributor
  • Adds support for partner records in the /record= path
  • Pulls in NyplSource mapper
  • Adds relevant tests
  • Not related: update package.json to fix some critical warnings

const { NyplSourceMapper, config } = require('@nypl/node-utils')

let nyplSourceMapperInstance = null
const getNyplSourceMapper = async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is totally fine, but the idea of the NyplSourceMapper is to load the instance in some initializer method at a high level in the app. Then the NyplSourceMapper.instance() is available as a synchronous method without having to deal with building your own singleton method. The module itself is already handling that.

nyplSourceMapperInstance = NyplSourceMapper.instance()
}
return nyplSourceMapperInstance
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we may have some issues in the singleton methods in nypl-source-mapper (NyplSourceMapper.loadInstance() creates a new instance every time) obligating you to write your own singleton handling here. That's fine for now, but we really ought to fix it in node-utils.

Also, I don't think you're using node-utils config, although you're requiring it and running config.loadConfig. Seems like config access in this app is already handled through a straight dotenv.config call; Loading config as you're doing here doesn't do anything. It would be cool to use node-utils config, but that seems maybe beyond the scope.

@danamansana
danamansana merged commit 9bc7add into main Aug 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants