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:
Yashas 2026-10-27 13:56:58 +05:30
parent 7103e7723f
commit 6ebb101e49
2 changed files with 4 additions and 2 deletions

View File

@ -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' }; const STOCK_LABEL: Record<string, string> = { available: 'Available', partial: 'Partially available', not_available: 'Not available' };
export function EnquiryPage() { 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 { client } = useZino();
const q = useQuery(async () => { const q = useQuery(async () => {
const r = await client.page(RV_ENQUIRIES, { limit: 1, filters: [{ field_key: 'instance_id', value: String(id), data_type: 'number' }] }); const r = await client.page(RV_ENQUIRIES, { limit: 1, filters: [{ field_key: 'instance_id', value: String(id), data_type: 'number' }] });

View File

@ -21,7 +21,8 @@ export function Inbox() {
const [state, setState] = useState<string>('Mine'); const [state, setState] = useState<string>('Mine');
const [q, setQ] = useState(''); const [q, setQ] = useState('');
const { data, error, loading } = useQuery(() => client.page(RV_ENQUIRIES, { limit: 200, sortBy: 'instance_id', sortDir: 'desc' }), [], 5000); 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 counts = useMemo(() => {
const c: Record<string, number> = { Mine: 0, All: rows.length }; const c: Record<string, number> = { Mine: 0, All: rows.length };