WIP SQL console: edit tab names

This commit is contained in:
Francesco
2023-10-22 14:43:38 +02:00
parent 0ec0f63359
commit d0fa9a0dc6
2 changed files with 15 additions and 5 deletions

View File

@@ -574,7 +574,9 @@ public class DefaultDbAdminController {
}
@GetMapping("/console/run/{queryId}")
public String consoleRun(Model model, @RequestParam(required = false) String query, @PathVariable String queryId) {
public String consoleRun(Model model, @RequestParam(required = false) String query,
@RequestParam(required = false) String queryTitle,
@PathVariable String queryId) {
ConsoleQuery activeQuery = consoleQueryRepository.findById(queryId).orElseThrow(() -> {
return new DbAdminNotFoundException("Query with ID " + queryId + " not found.");
});
@@ -582,6 +584,9 @@ public class DefaultDbAdminController {
if (query != null && !query.isBlank()) {
activeQuery.setSql(query);
}
if (queryTitle != null && !queryTitle.isBlank()) {
activeQuery.setTitle(queryTitle);
}
activeQuery.setUpdatedAt(LocalDateTime.now());
consoleQueryRepository.save(activeQuery);