Hide ignored noise from the inbox; open an enquiry by its BNK reference from notification links
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
7103e7723f
commit
6ebb101e49
@ -91,7 +91,8 @@ function fmtWindow(from: string, to: string): string {
|
||||
const STOCK_LABEL: Record<string, string> = { available: 'Available', partial: 'Partially available', not_available: 'Not available' };
|
||||
|
||||
export function EnquiryPage() {
|
||||
const { id } = useParams();
|
||||
// Notification emails link by reference (BNK-71772); the record is keyed by the number.
|
||||
const id = (useParams().id ?? '').replace(/^BNK-/i, '');
|
||||
const { client } = useZino();
|
||||
const q = useQuery(async () => {
|
||||
const r = await client.page(RV_ENQUIRIES, { limit: 1, filters: [{ field_key: 'instance_id', value: String(id), data_type: 'number' }] });
|
||||
|
||||
@ -21,7 +21,8 @@ export function Inbox() {
|
||||
const [state, setState] = useState<string>('Mine');
|
||||
const [q, setQ] = useState('');
|
||||
const { data, error, loading } = useQuery(() => client.page(RV_ENQUIRIES, { limit: 200, sortBy: 'instance_id', sortDir: 'desc' }), [], 5000);
|
||||
const rows = (data?.rows ?? []) as unknown as Enquiry[];
|
||||
// Noise the desk never answered (automated senders, newsletters) stays out of sight.
|
||||
const rows = ((data?.rows ?? []) as unknown as Enquiry[]).filter((r) => r.intake_status !== 'ignored');
|
||||
|
||||
const counts = useMemo(() => {
|
||||
const c: Record<string, number> = { Mine: 0, All: rows.length };
|
||||
|
||||
Loading…
Reference in New Issue
Block a user