better message

This commit is contained in:
Luke Berndt
2024-09-08 22:25:58 -04:00
parent 4fa539e9d5
commit 4d13c86c3e
2 changed files with 4 additions and 2 deletions

View File

@@ -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
}

View File

@@ -399,6 +399,7 @@ const System = () => {
<em>
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.<br/>
<p>If you export the file from Excel, make sure to use "Comma Separated Values" and NOT "CSV UTF-8" for the File Format.</p>
An example header line is: <br />
<code>Decimal,Alpha Tag,Description</code><br/>
<p>There can be additional columns so you can use the same Talkgroup CSV file from Trunk Recorder.</p>