Do not update the masterBotUserId if update change it to null

This commit is contained in:
2025-11-22 16:32:00 +07:00
parent 461a73a8e3
commit 9c8ab71736

View File

@@ -80,7 +80,8 @@ public class PostgreSqlBotRepository : IBotRepository
existingEntity.LastStartTime = bot.LastStartTime;
existingEntity.LastStopTime = bot.LastStopTime;
existingEntity.AccumulatedRunTimeSeconds = bot.AccumulatedRunTimeSeconds;
existingEntity.MasterBotUserId = bot.MasterBotUserId;
existingEntity.MasterBotUserId =
bot.MasterBotUserId ?? existingEntity.MasterBotUserId;
await _context.SaveChangesAsync().ConfigureAwait(false);
}