diff --git a/packages/backend/src/database.ts b/packages/backend/src/database.ts index 5f840da5..61f3263d 100644 --- a/packages/backend/src/database.ts +++ b/packages/backend/src/database.ts @@ -23,6 +23,7 @@ import { EnvironmentVariable } from './entity/EnvironmentVariable'; import { Domain } from './entity/Domain'; import { getEntities, loadAndSaveData } from './utils'; import { UserOrganization } from './entity/UserOrganization'; +import { Deployer } from './entity/Deployer'; const ORGANIZATION_DATA_PATH = '../test/fixtures/organizations.json'; @@ -573,4 +574,19 @@ export class Database { return domains; } + + async addDeployer (data: DeepPartial): Promise { + const deployerRepository = this.dataSource.getRepository(Deployer); + const newDomain = await deployerRepository.save(data); + + return newDomain; + } + + async getDeployerById (deployerId: string): Promise { + const deployerRepository = this.dataSource.getRepository(Deployer); + + const deployer = await deployerRepository.findOne({ where: { deployerId } }); + + return deployer; + } }