Skip to content

Commit

Permalink
fix: add name filter to open api spec
Browse files Browse the repository at this point in the history
  • Loading branch information
carere committed Jan 17, 2025
1 parent b937f1c commit d34b21f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ const CasesFiltersContext = createSimpleContext<CasesFiltersContextValue>(
export type CasesFiltersForm = {
statuses: CaseStatus[];
dateRange: DateRangeFilterForm;
name: string;
name?: string;
};

const emptyCasesFilters: CasesFiltersForm = {
statuses: [],
dateRange: null,
name: '',
};

function adaptFilterValues({
Expand Down
1 change: 1 addition & 0 deletions packages/app-builder/src/repositories/CaseRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Temporal } from 'temporal-polyfill';

export type CaseFilters = {
statuses?: CaseStatus[];
name?: string;
dateRange?:
| {
type: 'static';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ export default function Cases() {
} = useLoaderData<typeof loader>();
const inboxId = useParam('inboxId');

console.log('Filters', filters);

const { data, next, previous, reset } = useCursorPaginatedFetcher<
typeof loader,
PaginatedResponse<Case>
Expand Down
6 changes: 6 additions & 0 deletions packages/marble-api/openapis/marblecore-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ paths:
type: string
enum:
- created_at
- name: name
description: the field used to sort the items
in: query
required: false
schema:
type: string
- $ref: '#/components/parameters/offset_id'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/order'
Expand Down
4 changes: 3 additions & 1 deletion packages/marble-api/src/generated/marblecore-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,12 +819,13 @@ export function createDecision(createDecisionBody: CreateDecisionBody, opts?: Oa
/**
* List cases
*/
export function listCases({ status, inboxId, startDate, endDate, sorting, offsetId, limit, order }: {
export function listCases({ status, inboxId, startDate, endDate, sorting, name, offsetId, limit, order }: {
status?: CaseStatusDto[];
inboxId?: string[];
startDate?: string;
endDate?: string;
sorting?: "created_at";
name?: string;
offsetId?: string;
limit?: number;
order?: "ASC" | "DESC";
Expand All @@ -846,6 +847,7 @@ export function listCases({ status, inboxId, startDate, endDate, sorting, offset
start_date: startDate,
end_date: endDate,
sorting,
name,
offset_id: offsetId,
limit,
order
Expand Down

0 comments on commit d34b21f

Please sign in to comment.