File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -564,7 +564,7 @@ export const regenerateUserSSHKey = async (
564
564
export const getWorkspaceBuilds = async (
565
565
workspaceId : string ,
566
566
since : Date ,
567
- ) : Promise < TypesGen . WorkspaceBuild [ ] > => {
567
+ ) : Promise < TypesGen . WorkspaceBuild [ ] | null > => {
568
568
const response = await axios . get < TypesGen . WorkspaceBuild [ ] > (
569
569
`/api/v2/workspaces/${ workspaceId } /builds?since=${ since . toISOString ( ) } ` ,
570
570
)
Original file line number Diff line number Diff line change @@ -717,10 +717,11 @@ export const workspaceMachine = createMachine(
717
717
if ( context . workspace ) {
718
718
// For now, we only retrieve the last month of builds to minimize
719
719
// page bloat. We should add pagination in the future.
720
- return await API . getWorkspaceBuilds (
720
+ const builds = await API . getWorkspaceBuilds (
721
721
context . workspace . id ,
722
722
dayjs ( ) . add ( - 30 , "day" ) . toDate ( ) ,
723
723
)
724
+ return builds ?? [ ]
724
725
} else {
725
726
throw Error ( "Cannot get builds without id" )
726
727
}
You can’t perform that action at this time.
0 commit comments