mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-12-16 05:12:00 +09:00
WIP SQL console: edit tab names
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user