Skip to content

Commit f73a894

Browse files
committed
fix(dashboard): only validate sort on explicit --sort, not inherited from existing widget
1 parent 2d1312b commit f73a894

File tree

1 file changed

+3
-1
lines changed
  • src/commands/dashboard/widget

1 file changed

+3
-1
lines changed

src/commands/dashboard/widget/edit.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ function validateQueryConstraints(
146146
validateGroupByRequiresLimit(columns, limit ?? undefined);
147147
}
148148

149-
if (flags.sort || flags.query) {
149+
// Only validate sort when user explicitly passes --sort, not when merely
150+
// changing --query (which may leave the existing auto-defaulted sort stale)
151+
if (flags.sort) {
150152
const orderby =
151153
mergedQueries?.[0]?.orderby ?? existing.queries?.[0]?.orderby;
152154
const aggregates =

0 commit comments

Comments
 (0)