Skip to content

Commit

Permalink
Merge pull request #1168 from bierteam/remove-revhash
Browse files Browse the repository at this point in the history
Remove revhash
  • Loading branch information
NvdLaan authored Oct 17, 2023
2 parents 9823b88 + 50e76a8 commit 136ad35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
3 changes: 1 addition & 2 deletions beer-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"dependencies": {
"axios": "^1.4.0",
"moment": "^2.29.4",
"mongoose": "^7.4.3",
"rev-hash": "^4.0.0"
"mongoose": "^7.4.3"
},
"devDependencies": {
"dotenv": "^16.3.1",
Expand Down
8 changes: 0 additions & 8 deletions beer-import/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions beer-import/services/processData.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import revisionHash from 'rev-hash'
const uriPrettifier = require('./uriPrettifier')
const updateStores = require('./updateStores')
const moment = require('moment')
moment.locale('nl')
const validateKeys = require('./validateKeys')
const mandatoryKeys = ['id', 'brand', 'store', 'pricing', 'volume', 'rawValidity']
const crypto = require('crypto')
// TODO: Fix this
// const beer = require('../models/beer')
// const mandatoryKeys = beer.schema._requiredpaths
Expand All @@ -26,7 +26,7 @@ const processData = (data, stores) => {
data[obj].volume = data[obj].korte_name
data[obj].rawUri = data[obj].aanbieding_link
data[obj].rawValidity = data[obj].einddatum
data[obj].id = revisionHash(data[obj].uid)
data[obj].id = crypto.createHash('md5').update(data[obj].uid).digest('hex').slice(0, 10)
delete data[obj].merken_soort_omschrijving
delete data[obj].brouwerij_omschrijving
delete data[obj].gisting_omschrijving
Expand Down

0 comments on commit 136ad35

Please sign in to comment.