Skip to content

Commit

Permalink
Merge pull request #234 from hyeeyoung/dev
Browse files Browse the repository at this point in the history
release 1.2.1
  • Loading branch information
hyejungg authored Dec 5, 2022
2 parents c387162 + a9f5726 commit 2f91349
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/models/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ const S3ImageUtils = require('../utils/S3ImageUtils');
module.exports = {
insertItem: async function (req) {
const userId = Number(req.decoded);
const folderId = !req.body.folder_id ? null : Number(req.body.folder_id);
let folderId = !req.body.folder_id ? null : Number(req.body.folder_id);
const itemName = trimToString(req.body.item_name);
const itemPrice = !req.body.item_price ? 0 : req.body.item_price;
const itemUrl = !req.body.item_url ? null : trimToString(req.body.item_url);
const itemMemo = trimToString(req.body.item_memo);

if (isNaN(folderId)) {
folderId = null;
}

const params = [userId, folderId, itemName, itemPrice, itemUrl, itemMemo];

let sqlInsert;
Expand Down

0 comments on commit 2f91349

Please sign in to comment.