@@ -602,11 +602,12 @@ export class StackService {
602
602
* If the branch is part of a stack and if the stackId is provided, this will include only the changes up to the next branch in the stack.
603
603
* Otherwise, if stackId is not provided, this will include all changes as compared to the target branch
604
604
*/
605
- branchChanges ( args : { projectId : string ; stackId ?: string ; branch : BranchRef } ) {
605
+ branchChanges ( args : { projectId : string ; stackId ?: string | null ; branch : BranchRef } ) {
606
606
return this . api . endpoints . branchChanges . useQuery (
607
607
{
608
608
projectId : args . projectId ,
609
- stackId : args . stackId ,
609
+ // Handle case where URL parameters convert null to "null" string
610
+ stackId : args . stackId === 'null' ? null : args . stackId ,
610
611
branch : args . branch
611
612
} ,
612
613
{
@@ -618,11 +619,12 @@ export class StackService {
618
619
) ;
619
620
}
620
621
621
- branchChange ( args : { projectId : string ; stackId ?: string ; branch : BranchRef ; path : string } ) {
622
+ branchChange ( args : { projectId : string ; stackId ?: string | null ; branch : BranchRef ; path : string } ) {
622
623
return this . api . endpoints . branchChanges . useQuery (
623
624
{
624
625
projectId : args . projectId ,
625
- stackId : args . stackId ,
626
+ // Handle case where URL parameters convert null to "null" string
627
+ stackId : args . stackId === 'null' ? null : args . stackId ,
626
628
branch : args . branch
627
629
} ,
628
630
{ transform : ( result ) => changesSelectors . selectById ( result . changes , args . path ) }
@@ -631,14 +633,15 @@ export class StackService {
631
633
632
634
async branchChangesByPaths ( args : {
633
635
projectId : string ;
634
- stackId ?: string ;
636
+ stackId ?: string | null ;
635
637
branch : BranchRef ;
636
638
paths : string [ ] ;
637
639
} ) {
638
640
const result = await this . api . endpoints . branchChanges . fetch (
639
641
{
640
642
projectId : args . projectId ,
641
- stackId : args . stackId ,
643
+ // Handle case where URL parameters convert null to "null" string
644
+ stackId : args . stackId === 'null' ? null : args . stackId ,
642
645
branch : args . branch
643
646
} ,
644
647
{ transform : ( result ) => selectChangesByPaths ( result . changes , args . paths ) }
@@ -1185,7 +1188,7 @@ function injectEndpoints(api: ClientState['backendApi'], uiState: UiState) {
1185
1188
} ) ,
1186
1189
branchChanges : build . query <
1187
1190
{ changes : EntityState < TreeChange , string > ; stats : TreeStats } ,
1188
- { projectId : string ; stackId ?: string ; branch : BranchRef }
1191
+ { projectId : string ; stackId ?: string | null ; branch : BranchRef }
1189
1192
> ( {
1190
1193
extraOptions : { command : 'changes_in_branch' } ,
1191
1194
query : ( args ) => args ,
0 commit comments