set user in tag only if user exists in processing
MODIFY
src/server/rest/v1/service/TagService.ts
src/server/rest/v1/service/TagService.ts
@@ -774,11 +774,13 @@ export default class TagService {
const newImportedTag: ImportedTag = {
id: importedTag.id.toUpperCase(),
visualID: importedTag.visualID,
- description: importedTag.description ? importedTag.description : `Badge ID '${importedTag.id}'`,
- name: importedTag.name?.toUpperCase() || '',
- firstName: importedTag.firstName || '',
- email: importedTag.email || '',
+ description: importedTag.description ? importedTag.description : `Badge ID '${importedTag.id}'`
};
+ if (importedTag.name && importedTag.firstName && importedTag.email) {
+ newImportedTag.name = importedTag.name.toUpperCase();
+ newImportedTag.firstName = importedTag.firstName;
+ newImportedTag.email = importedTag.email;
+ }
// Validate Tag data
TagValidator.getInstance().validateImportedTagCreation(newImportedTag);
// Set properties
@@ -788,9 +790,6 @@ export default class TagService {
try {
UserValidator.getInstance().validateImportedUserCreation(newImportedTag as ImportedUser);
} catch (error) {
- newImportedTag.email = '';
- newImportedTag.name = '';
- newImportedTag.firstName = '';
await Logging.logWarning({
tenantID: req.user.tenantID,
module: MODULE_NAME, method: 'processTag',

set user in tag only if user exists in processing