deleted unescape as it's handled by csvtojson
MODIFY
src/server/rest/v1/service/TagService.ts
src/server/rest/v1/service/TagService.ts
@@ -761,10 +761,10 @@ export default class TagService {
try {
const newImportedTag: ImportedTag = {
id: importedTag.id.toUpperCase(),
- description: importedTag.description ? Utils.unescapeCsvValue(importedTag.description) : `Badge ID '${importedTag.id}'`,
- name: Utils.unescapeCsvValue(importedTag.name.toUpperCase()),
- firstName: Utils.unescapeCsvValue(importedTag.firstName),
- email: Utils.unescapeCsvValue(importedTag.email),
+ description: importedTag.description ? importedTag.description : `Badge ID '${importedTag.id}'`,
+ name: importedTag.name.toUpperCase(),
+ firstName: importedTag.firstName,
+ email: importedTag.email,
};
// Validate Tag data
TagValidator.getInstance().validateImportedTagCreation(newImportedTag);

MODIFY
src/server/rest/v1/service/UserService.ts
src/server/rest/v1/service/UserService.ts
@@ -1341,9 +1341,9 @@ export default class UserService {
private static async processUser(action: ServerAction, req: Request, importedUser: ImportedUser, usersToBeImported: ImportedUser[]): Promise<boolean> {
try {
const newImportedUser: ImportedUser = {
- name: Utils.unescapeCsvValue(importedUser.name.toUpperCase()),
- firstName: Utils.unescapeCsvValue(importedUser.firstName),
- email: Utils.unescapeCsvValue(importedUser.email),
+ name: importedUser.name.toUpperCase(),
+ firstName: importedUser.firstName,
+ email: importedUser.email,
};
// Validate User data
UserValidator.getInstance().validateImportedUserCreation(newImportedUser);

MODIFY
src/utils/Utils.ts
src/utils/Utils.ts
@@ -1512,8 +1512,6 @@ export default class Utils {
// when importing values
public static unescapeCsvValue(value: any): string {
- // starting and ending double quotes are handle by csvToJson
- // replace double double quotes inside value into simple double quotes
- return typeof value === 'string' ? value.replace(/""/g, '"') : value;
+ // double quotes are handle by csvToJson
}
}

deleted unescape as it's handled by csvtojson