"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SeedUpdateUser1641348681524 = void 0;
const typeorm_1 = require("typeorm");
const auth_base_1 = require("@things-factory/auth-base");
const SEED = [
    {
        email: 'admin@ai-doop.com'
    }
];
class SeedUpdateUser1641348681524 {
    async up(queryRunner) {
        const repository = (0, typeorm_1.getRepository)(auth_base_1.User);
        // const domain: Domain = await getRepository(Domain).findOneBy({
        //   name: 'SYSTEM'
        // })
        return await Promise.all(SEED.map(async (updateUser) => {
            await repository.update({ email: 'admin@hatiolab.com' }, updateUser);
        }));
    }
    async down(queryRunner) {
        const repository = (0, typeorm_1.getRepository)(auth_base_1.User);
        // const domain: Domain = await getRepository(Domain).findOneBy({
        //   name: 'SYSTEM'
        // })
        return await Promise.all(SEED.reverse().map(async (user) => {
            await repository.update({ email: user.email }, { email: 'admin@hatiolab.com' });
        }));
    }
}
exports.SeedUpdateUser1641348681524 = SeedUpdateUser1641348681524;
//# sourceMappingURL=1641348681524-SeedUpdateUser.js.map