Ensure forwardCredentials is included when exporting servers as CSV

This commit is contained in:
Alejandro Celaya
2025-04-20 12:45:33 +02:00
parent 1467c8e416
commit 4895cbb9dc
3 changed files with 48 additions and 27 deletions

View File

@@ -45,4 +45,12 @@ export const isNotFoundServer = (server: SelectedServer): server is NotFoundServ
export const getServerId = (server: SelectedServer) => (isServerWithId(server) ? server.id : '');
export const serverWithIdToServerData = ({ name, url, apiKey }: ServerWithId): ServerData => ({ name, url, apiKey });
/**
* Expose values that represent provided server, in a way that can be serialized in JSON or CSV strings.
*/
export const serializeServer = ({ name, url, apiKey, forwardCredentials }: ServerData): Record<string, string> => ({
name,
url,
apiKey,
forwardCredentials: forwardCredentials ? 'true' : 'false',
});