Skip to content

Commit

Permalink
Merge pull request #162 from julianpoy/fix-lcb-import-fields
Browse files Browse the repository at this point in the history
Fix lcb import fields
  • Loading branch information
julianpoy authored Feb 15, 2019
2 parents 215045a + e23392b commit 304519f
Show file tree
Hide file tree
Showing 10 changed files with 2,279 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var devMode = appConfig.environment === 'dev';

Raven.config(appConfig.sentry.dsn, {
environment: appConfig.environment,
release: '1.5.0'
release: '1.5.1'
}).install();

// Routes
Expand Down
19 changes: 19 additions & 0 deletions Backend/output

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions Backend/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,19 @@ router.post(
let createdAt = new Date(lcbRecipe.createdate || Date.now())
let updatedAt = new Date(lcbRecipe.modifieddate || Date.now())

let totalTime = (lcbRecipe.readyintime || '').toString().trim()
if (lcbRecipe.cookingtime) {
totalTime += ` (${lcbRecipe.cookingtime.toString().trim()} cooking time)`;
}
totalTime = totalTime.trim();

return Recipe.create({
userId: res.locals.session.userId,
title: lcbRecipe.recipename || '',
description,
yield: lcbRecipe.yield || '',
activeTime: lcbRecipe.preparationtime || '',
totalTime: lcbRecipe.readyintime || '',
yield: (lcbRecipe.yield || '').toString(),
activeTime: (lcbRecipe.preparationtime || '').toString(),
totalTime,
source: lcbRecipe.source || '',
url: lcbRecipe.webpage || '',
notes,
Expand Down
2 changes: 1 addition & 1 deletion Backend/routes/recipes.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ router.get(
userId: res.locals.session.userId,
folder: req.query.folder
},
attributes: ['id', 'title', 'description', 'source', 'image', 'folder', 'fromUserId', 'createdAt', 'updatedAt'],
attributes: ['id', 'title', 'description', 'source', 'url', 'image', 'folder', 'fromUserId', 'createdAt', 'updatedAt'],
include: [{
model: User,
as: 'fromUser',
Expand Down
Loading

0 comments on commit 304519f

Please sign in to comment.