Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions redisinsight/api/src/modules/database/database.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ export class DatabaseService {
try {
this.logger.log('Creating new database.');

const database = await this.repository.create(
await this.databaseFactory.createDatabaseModel(classToClass(Database, dto)),
);
const database = await this.repository.create({
...await this.databaseFactory.createDatabaseModel(classToClass(Database, dto)),
new: true,
});

// todo: clarify if we need this and if yes - rethink implementation
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export class DatabaseFactory {

model.modules = await this.databaseInfoProvider.determineDatabaseModules(client);
model.lastConnection = new Date();
model.new = true

await client.disconnect();

Expand Down
3 changes: 1 addition & 2 deletions redisinsight/api/test/api/database/PUT-databases-id.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ describe(`PUT /databases/:id`, () => {
after: async () => {
newDatabase = await localDb.getInstanceById(constants.TEST_INSTANCE_ID_3);
expect(newDatabase).to.contain({
..._.omit(oldDatabase, ['modules', 'provider', 'lastConnection']),
new: true,
..._.omit(oldDatabase, ['modules', 'provider', 'lastConnection', 'new']),
host: constants.TEST_REDIS_HOST,
port: constants.TEST_REDIS_PORT,
});
Expand Down