This commit is contained in:
@@ -313,6 +313,21 @@ export const api = {
|
||||
dry_run: input?.dry_run ?? false
|
||||
})
|
||||
},
|
||||
plans: {
|
||||
list: async (params?: { status?: string; priority?: string; project_id?: string; limit?: number }) => {
|
||||
const filters: ResolveSpecFilter[] = [];
|
||||
if (params?.status) filters.push({ column: 'status', operator: 'eq', value: params.status });
|
||||
if (params?.priority) filters.push({ column: 'priority', operator: 'eq', value: params.priority });
|
||||
if (params?.project_id) filters.push({ column: 'project_id', operator: 'eq', value: params.project_id });
|
||||
|
||||
const rows = await rsReadMany<Omit<import('./types').Plan, 'tags'> & { tags?: unknown }>('plans', {
|
||||
filters,
|
||||
limit: params?.limit ?? 500,
|
||||
sort: [{ column: 'updated_at', direction: 'desc' }]
|
||||
});
|
||||
return rows.map((row) => ({ ...row, tags: normalizeTags(row.tags) }));
|
||||
}
|
||||
},
|
||||
stats: async () => {
|
||||
type StatsThoughtRow = {
|
||||
metadata?: {
|
||||
|
||||
Reference in New Issue
Block a user