Remove partial user
MODIFY
src/async-task/tasks/UsersImportAsyncTask.ts
src/async-task/tasks/UsersImportAsyncTask.ts
import { ActionsResponse, ImportStatus } from '../../types/GlobalType';
-import { ImportedUser, UserRole, UserStatus } from '../../types/User';
+import User, { ImportedUser, UserRole, UserStatus } from '../../types/User';
import AbstractAsyncTask from '../AsyncTask';
import Constants from '../../utils/Constants';
@@ -63,7 +63,7 @@ export default class UsersImportAsyncTask extends AbstractAsyncTask {
continue;
}
// New User
- const newUser = UserStorage.createNewUser();
+ const newUser = UserStorage.createNewUser() as User;
// Set
newUser.firstName = importedUser.firstName;
newUser.name = importedUser.name;

MODIFY
src/storage/mongodb/UserStorage.ts
src/storage/mongodb/UserStorage.ts
@@ -182,7 +182,7 @@ export default class UserStorage {
await Logging.traceEnd(tenantID, MODULE_NAME, 'addSitesToUser', uniqueTimerID, siteIDs);
}
- public static async saveUser(tenantID: string, userToSave: Partial<User>, saveImage = false): Promise<string> {
+ public static async saveUser(tenantID: string, userToSave: User, saveImage = false): Promise<string> {
// Debug
const uniqueTimerID = Logging.traceStart(tenantID, MODULE_NAME, 'saveUser');
// Check Tenant

Remove partial user