Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove revhash #1168

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Dismissed Show dismissed Hide dismissed
delete data[obj].brouwerij_omschrijving
delete data[obj].gisting_omschrijving
Expand Down
Loading