Skip to content

Commit

Permalink
preparing id shortening #77
Browse files Browse the repository at this point in the history
  • Loading branch information
frytg committed Jul 19, 2021
1 parent cbdc264 commit a665059
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ingest/events/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ module.exports = async (req, res) => {
const urnPublisherPrefix = config.coreIdPrefixes.Publisher

// add trailing 0 if number is only 5 digits
if (service.publisherId.length === 5)
service.publisherId = `${service.publisherId}0`
if (service.publisherId.length > 5)
service.publisherId = service.publisherId.substr(0, 5)

// create hash using given publisherId
service.publisherId = `${urnPublisherPrefix}${core.createHashedId(
Expand Down

0 comments on commit a665059

Please sign in to comment.