Refacto rest api, fix graphl playground, improve analytics (#5844)

- Improve the rest api by introducing startingAfter/endingBefore (we
previously had lastCursor), and moving pageInfo/totalCount outside of
the data object.
- Fix broken GraphQL playground on website
- Improve analytics by sending server url
This commit is contained in:
Félix Malfait
2024-06-12 21:54:33 +02:00
committed by GitHub
parent 04edf2bf7b
commit 374237a988
22 changed files with 277 additions and 131 deletions

View File

@ -33,20 +33,23 @@ const TokenForm = ({
const [isLoading, setIsLoading] = useState(false);
const [locationSetting, setLocationSetting] = useState(
(window &&
(typeof window !== 'undefined' &&
window.localStorage.getItem('baseUrl') &&
JSON.parse(window.localStorage.getItem('baseUrl') ?? '')
?.locationSetting) ??
'production',
);
const [baseUrl, setBaseUrl] = useState(
(window.localStorage.getItem('baseUrl') &&
(typeof window !== 'undefined' &&
window.localStorage.getItem('baseUrl') &&
JSON.parse(window.localStorage.getItem('baseUrl') ?? '')?.baseUrl) ??
'https://api.twenty.com',
);
const tokenLocal = window?.localStorage?.getItem?.(
'TryIt_securitySchemeValues',
const tokenLocal = (
typeof window !== 'undefined'
? window?.localStorage?.getItem?.('TryIt_securitySchemeValues')
: '{}'
) as string;
const token = JSON.parse(tokenLocal)?.bearerAuth ?? '';