diff --git a/admin/server/controllers/talkgroups.js b/admin/server/controllers/talkgroups.js index b4c1a96..62d1050 100644 --- a/admin/server/controllers/talkgroups.js +++ b/admin/server/controllers/talkgroups.js @@ -79,7 +79,7 @@ exports.exportTalkgroups = function (req, res, next) { async function csv_import(shortName, filename, callback) { var talkgroups = []; - const count = await Talkgroup.deleteMany({ shortName: shortName }); + var parser = parse( { @@ -90,6 +90,7 @@ async function csv_import(shortName, filename, callback) { console.error("Error: csv import 2: " + err); callback(err, null); } else { + const count = await Talkgroup.deleteMany({ shortName: shortName }); var response = []; for (var i = 0; i < data.length; i++) { @@ -97,7 +98,7 @@ async function csv_import(shortName, filename, callback) { if (!( "Decimal" in row) || !("Description" in row) || !("Alpha Tag" in row)) { console.error("Error: csv import column header error"); console.error(row) - callback("Column Headers are required - Required Columns: 'Decimal' 'Decscription' 'Alpha Tag' Optional Column: 'Priority' ", null); + callback("Column Headers are required - Required Columns: 'Decimal' 'Description' 'Alpha Tag' Optional Column: 'Priority' ", null); return } diff --git a/admin/src/System/System.js b/admin/src/System/System.js index 2d7e619..ae3a3f0 100644 --- a/admin/src/System/System.js +++ b/admin/src/System/System.js @@ -399,6 +399,7 @@ const System = () => { The Talkgroup file is a .CSV file that has infromation about the different talkgroups on the system. Headers are required for the columns, and should be the first line of the file. The columns can be in any order, but the headers must match exactly.
+

If you export the file from Excel, make sure to use "Comma Separated Values" and NOT "CSV UTF-8" for the File Format.

An example header line is:
Decimal,Alpha Tag,Description

There can be additional columns so you can use the same Talkgroup CSV file from Trunk Recorder.