Skip to content

Commit

Permalink
Feature: support text csv (#3123)
Browse files Browse the repository at this point in the history
* add validation for when app is loading

* add text/csv to supported responses
  • Loading branch information
thewahome authored Apr 29, 2024
1 parent f3e73d6 commit a84d7a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/services/actions/query-action-creator-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ export function parseResponse(
return response.json();
case ContentType.XML:
case ContentType.HTML:
case ContentType.TextCsv:
case ContentType.TextPlain:
return response.text();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export const ValidationProvider = ({ children }: ValidationProviderProps) => {
}, [resources])

useEffect(() => {
if (!queryVersion || !query || Object.keys(resources.data).length === 0) {
return;
}
if (version !== queryVersion && GRAPH_API_VERSIONS.includes(queryVersion)
&& resources.data[queryVersion].children!.length > 0) {
setVersionedResources(resources.data[queryVersion].children!);
Expand Down
1 change: 1 addition & 0 deletions src/types/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export enum ContentType {
TextPlain = 'text/plain',
HTML = 'text/html',
BinaryResponse = 'application/octet-stream',
TextCsv = 'text/csv',
}

export enum AppTheme {
Expand Down

0 comments on commit a84d7a4

Please sign in to comment.