is there a way to create a segment with that starts with an initial filter
Example
I have a segment the show orders i want when the user clicks on the segment is loads with an initial filter which the user can clear if they want
Code
export const ordersNotInvoicedSegment = (app: INestApplication, collection: CollectionCustomizer<Schema, 'orders'>) => {
const orderService: OrderService = app.get<OrderService>(OrderService, { strict: false })
collection.addSegment('Orders Not Invoiced', async (context) => {
const ordersNotInvoiced = await orderService.getOrdersNotInvoiced()
return { field: 'id', operator: 'In', value: ordersNotInvoiced.map((r) => r.id) }
})
}
is possible to add the filter when use clicks on the segment?