Skip to content

Commit 864ef6b

Browse files
authored
fix contract filtering (#119)
1 parent 0b60d9e commit 864ef6b

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/lib/contracts/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
} from "../../helpers/errors.ts";
1212
import { ContractList } from "./ContractDisplay.tsx";
1313
import type { ActiveContract, Contract } from "./types.ts";
14+
import type { ContractState } from "./utils.ts";
1415

1516
export function registerContracts(program: Command) {
1617
program
@@ -67,10 +68,8 @@ async function listContracts(
6768

6869
const api = await apiClient();
6970

70-
const state = showAll
71-
? "all"
72-
: (stateFilter?.toLowerCase() as "expired" | "active" | "upcoming") ||
73-
undefined;
71+
const state = showAll ? "All" : (stateFilter as ContractState) ||
72+
undefined;
7473

7574
const { data, error, response } = await api.GET("/v0/contracts", {
7675
params: {

src/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3518,7 +3518,7 @@ export interface operations {
35183518
active_within_interval_start?: string;
35193519
active_within_interval_end?: string;
35203520
instance_type?: string;
3521-
state?: "all" | "active" | "upcoming" | "expired";
3521+
state?: "All" | "Active" | "Upcoming" | "Expired";
35223522
};
35233523
header?: {
35243524
/** @description Generate a bearer token with `$ sf tokens create`. */

0 commit comments

Comments
 (0)