query serializer

This commit is contained in:
Nate Kelley 2025-09-25 10:46:31 -06:00
parent 113da029fe
commit 34914026a5
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
5 changed files with 42 additions and 15 deletions

View File

@ -127,6 +127,7 @@
"@tiptap/react": "^3.5.0",
"@tiptap/starter-kit": "^3.5.0",
"@tiptap/suggestion": "^3.5.0",
"@types/qs": "^6.14.0",
"@udecode/cn": "^49.0.15",
"@uploadthing/react": "^7.3.3",
"axios": "catalog:",
@ -157,6 +158,7 @@
"platejs": "49.2.21",
"pluralize": "^8.0.0",
"posthog-js": "^1.268.1",
"qs": "^6.14.0",
"react": "catalog:",
"react-colorful": "^5.6.1",
"react-day-picker": "^8.10.1",

View File

@ -1,4 +1,5 @@
import type { SearchTextRequest, SearchTextResponse } from '@buster/server-shared/search';
import qs from 'qs';
import { mainApiV2 } from '../instances';
export const search = async (params: SearchTextRequest) => {

View File

@ -1,6 +1,7 @@
import { isServer } from '@tanstack/react-query';
import type { AxiosRequestHeaders } from 'axios';
import axios, { type AxiosError, type InternalAxiosRequestConfig } from 'axios';
import qs from 'qs';
import { getSupabaseSession } from '@/integrations/supabase/getSupabaseUserClient';
import { Route as AuthRoute } from '@/routes/auth.login';
import { BASE_URL_V2 } from './config';
@ -15,6 +16,9 @@ export const createAxiosInstance = (baseURL = BASE_URL_V2) => {
headers: {
'Content-Type': 'application/json',
},
paramsSerializer: (params) => {
return qs.stringify(params, { arrayFormat: 'repeat' }); //💰
},
});
// Response interceptor with retry logic for auth errors

View File

@ -9,6 +9,7 @@ import {
import { useDebounce } from '@/hooks/useDebounce';
import { useMemoizedFn } from '@/hooks/useMemoizedFn';
import { formatDate } from '@/lib/date';
import { assetTypeToIcon } from '../icons/assetIcons';
export const AddMetricModal: React.FC<{
open: boolean;
@ -58,22 +59,30 @@ export const AddMetricModal: React.FC<{
{
title: 'Title',
dataIndex: 'title',
render: (value) => {
// biome-ignore lint/security/noDangerouslySetInnerHtml: <explanation>
return <span dangerouslySetInnerHTML={{ __html: value }}></span>;
render: (value, record) => {
const Icon = assetTypeToIcon(record.assetType);
return (
<div className="flex items-center gap-1.5">
<span className="text-icon-color">
<Icon />
</span>
{/* biome-ignore lint/security/noDangerouslySetInnerHtml: this endpoint is sanitized */}
<span dangerouslySetInnerHTML={{ __html: value }}></span>
</div>
);
},
},
{
title: 'Updated at',
dataIndex: 'updatedAt',
width: 140,
render: (value) => {
return formatDate({
date: value,
format: 'lll',
});
},
},
// {
// title: 'Updated',
// dataIndex: 'updated_at',
// width: 140,
// render: (value) => {
// return formatDate({
// date: value,
// format: 'lll',
// });
// },
// },
],
[]
);

View File

@ -703,6 +703,9 @@ importers:
'@tiptap/suggestion':
specifier: ^3.5.0
version: 3.5.0(@tiptap/core@3.5.0(@tiptap/pm@3.5.0))(@tiptap/pm@3.5.0)
'@types/qs':
specifier: ^6.14.0
version: 6.14.0
'@udecode/cn':
specifier: ^49.0.15
version: 49.0.15(@types/react@19.1.13)(class-variance-authority@0.7.1)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(tailwind-merge@3.3.1)
@ -793,6 +796,9 @@ importers:
posthog-js:
specifier: ^1.268.1
version: 1.268.1
qs:
specifier: ^6.14.0
version: 6.14.0
react:
specifier: 'catalog:'
version: 19.1.1
@ -6356,6 +6362,9 @@ packages:
'@types/prismjs@1.26.5':
resolution: {integrity: sha512-AUZTa7hQ2KY5L7AmtSiqxlhWxb4ina0yd8hNbl4TWuqnv/pFP0nDMb3YrfSBf4hJVGLh2YEIBfKaBW/9UEl6IQ==}
'@types/qs@6.14.0':
resolution: {integrity: sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==}
'@types/react-dom@19.1.9':
resolution: {integrity: sha512-qXRuZaOsAdXKFyOhRBg6Lqqc0yay13vN7KrIg4L7N4aaHN68ma9OK3NE1BoDFgFOTfM7zg+3/8+2n8rLUH3OKQ==}
peerDependencies:
@ -19323,6 +19332,8 @@ snapshots:
'@types/prismjs@1.26.5': {}
'@types/qs@6.14.0': {}
'@types/react-dom@19.1.9(@types/react@19.1.13)':
dependencies:
'@types/react': 19.1.13
@ -19591,7 +19602,7 @@ snapshots:
sirv: 3.0.1
tinyglobby: 0.2.14
tinyrainbow: 2.0.0
vitest: 3.2.4(@edge-runtime/vm@3.2.0)(@types/debug@4.1.12)(@types/node@22.18.1)(@vitest/browser@3.2.4)(@vitest/ui@3.2.4)(jiti@2.5.1)(jsdom@27.0.0(postcss@8.5.6))(lightningcss@1.30.1)(msw@2.11.3(@types/node@22.18.1)(typescript@5.9.2))(sass@1.93.1)(terser@5.43.1)(tsx@4.20.5)(yaml@2.8.1)
vitest: 3.2.4(@edge-runtime/vm@3.2.0)(@types/debug@4.1.12)(@types/node@24.3.1)(@vitest/browser@3.2.4)(@vitest/ui@3.2.4)(jiti@2.5.1)(jsdom@27.0.0(postcss@8.5.6))(lightningcss@1.30.1)(msw@2.11.3(@types/node@24.3.1)(typescript@5.9.2))(sass@1.93.1)(terser@5.43.1)(tsx@4.20.5)(yaml@2.8.1)
'@vitest/utils@3.2.4':
dependencies: