Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: polonel/trudesk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.6
Choose a base ref
...
head repository: polonel/trudesk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.1.7
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jul 12, 2021

  1. Copy the full SHA
    d2cab62 View commit details

Commits on Jul 15, 2021

  1. Merge branch 'develop'

    polonel committed Jul 15, 2021
    Copy the full SHA
    dc00c50 View commit details
  2. chore(release): 1.1.7

    ## [1.1.7](v1.1.6...v1.1.7) (2021-07-15)
    
    ### Bug Fixes
    
    * **import:** importing users with csv [#418](#418) ([d2cab62](d2cab62))
    polonel committed Jul 15, 2021
    Copy the full SHA
    463607b View commit details
Showing with 20 additions and 9 deletions.
  1. +7 −0 CHANGELOG.md
  2. +1 −1 package.json
  3. +12 −8 src/controllers/accounts.js
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.1.7](https://github.com/polonel/trudesk/compare/v1.1.6...v1.1.7) (2021-07-15)


### Bug Fixes

* **import:** importing users with csv [#418](https://github.com/polonel/trudesk/issues/418) ([d2cab62](https://github.com/polonel/trudesk/commit/d2cab62))

## [1.1.6](https://github.com/polonel/trudesk/compare/v1.1.5...v1.1.6) (2021-06-21)


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trudesk",
"version": "1.1.6",
"version": "1.1.7",
"private": true,
"engines": {
"node": ">=9.10.0"
20 changes: 12 additions & 8 deletions src/controllers/accounts.js
Original file line number Diff line number Diff line change
@@ -288,7 +288,9 @@ accountsController.uploadCSV = function (req, res) {
})

var object = {}
var parser = csv()

var parser = csv.parse()

busboy.on('file', function (fieldname, file) {
object.csv = []

@@ -309,11 +311,13 @@ accountsController.uploadCSV = function (req, res) {
})

parser
.on('readable', function () {
var data
while ((data = parser.read()) !== null) {
object.csv.push(data)
}
.on('data', function (row) {
object.csv.push(row)
// var data
// while ((data = parser.read()) !== null) {
// console.log(data)
// object.csv.push(data)
// }
})
.on('end', function () {
if (object.csv.length < 1) {
@@ -325,7 +329,7 @@ accountsController.uploadCSV = function (req, res) {
return i.toLowerCase() === 'username'
})
var fullnameIdx = _.findIndex(titleRow, function (i) {
return i.toLowerCase() === 'fullname'
return i.toLowerCase() === 'name'
})
var emailIdx = _.findIndex(titleRow, function (i) {
return i.toLowerCase() === 'email'
@@ -334,7 +338,7 @@ accountsController.uploadCSV = function (req, res) {
return i.toLowerCase() === 'title'
})
var roleIdx = _.findIndex(titleRow, function (i) {
return i.toLowerCase() === 'role'
return i.toLowerCase() === 'roleid'
})

object.csv.splice(0, 1)