mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-13 01:38:35 +00:00
updates api readers for platforms and compliance Data types. adds link for purge policies
This commit is contained in:
parent
cec37f49e6
commit
43f40cd4f1
@ -2,6 +2,17 @@
|
|||||||
<header class="metadata-prompt__header">
|
<header class="metadata-prompt__header">
|
||||||
<p>
|
<p>
|
||||||
Compliance Purge Policy
|
Compliance Purge Policy
|
||||||
|
|
||||||
|
<a
|
||||||
|
target="_blank"
|
||||||
|
href="http://go/gdpr/deletions/purgePolicies">
|
||||||
|
<sup>
|
||||||
|
More Info
|
||||||
|
|
||||||
|
<span class="glyphicon glyphicon-question-sign"
|
||||||
|
title="More information Purge Policies"></span>
|
||||||
|
</sup>
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@ -29,7 +29,5 @@ export interface IComplianceDataType {
|
|||||||
* @interface IComplianceDataTypeResponse
|
* @interface IComplianceDataTypeResponse
|
||||||
*/
|
*/
|
||||||
export interface IComplianceDataTypeResponse {
|
export interface IComplianceDataTypeResponse {
|
||||||
status: ApiStatus;
|
|
||||||
complianceDataTypes?: Array<IComplianceDataType>;
|
complianceDataTypes?: Array<IComplianceDataType>;
|
||||||
msg?: string;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,10 +21,6 @@ export interface IDataPlatform {
|
|||||||
* @interface IPlatformsResponse
|
* @interface IPlatformsResponse
|
||||||
*/
|
*/
|
||||||
export interface IPlatformsResponse {
|
export interface IPlatformsResponse {
|
||||||
// Response status
|
|
||||||
status: ApiStatus;
|
|
||||||
// optional platforms property containing the list of platforms
|
// optional platforms property containing the list of platforms
|
||||||
platforms?: Array<IDataPlatform>;
|
platforms?: Array<IDataPlatform>;
|
||||||
// optional api error message
|
|
||||||
msg?: string;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { IComplianceDataType, IComplianceDataTypeResponse } from 'wherehows-web/typings/api/list/compliance-datatypes';
|
import { IComplianceDataType, IComplianceDataTypeResponse } from 'wherehows-web/typings/api/list/compliance-datatypes';
|
||||||
import { ApiStatus } from 'wherehows-web/utils/api';
|
|
||||||
import { getJSON } from 'wherehows-web/utils/api/fetcher';
|
import { getJSON } from 'wherehows-web/utils/api/fetcher';
|
||||||
import { getListUrlRoot } from 'wherehows-web/utils/api/list/shared';
|
import { getListUrlRoot } from 'wherehows-web/utils/api/list/shared';
|
||||||
|
|
||||||
@ -14,15 +13,11 @@ const complianceDataTypesUrl = `${getListUrlRoot('v2')}/complianceDataTypes`;
|
|||||||
* @returns {Promise<Array<IComplianceDataType>>}
|
* @returns {Promise<Array<IComplianceDataType>>}
|
||||||
*/
|
*/
|
||||||
const readComplianceDataTypes = async (): Promise<Array<IComplianceDataType>> => {
|
const readComplianceDataTypes = async (): Promise<Array<IComplianceDataType>> => {
|
||||||
const { status, complianceDataTypes = [], msg } = await getJSON<IComplianceDataTypeResponse>({
|
const { complianceDataTypes = [] } = await getJSON<IComplianceDataTypeResponse>({
|
||||||
url: complianceDataTypesUrl
|
url: complianceDataTypesUrl
|
||||||
});
|
});
|
||||||
|
|
||||||
if (status === ApiStatus.OK && complianceDataTypes.length) {
|
|
||||||
return complianceDataTypes;
|
return complianceDataTypes;
|
||||||
}
|
|
||||||
|
|
||||||
throw new Error(msg);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export { readComplianceDataTypes };
|
export { readComplianceDataTypes };
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { IPlatformsResponse, IDataPlatform } from 'wherehows-web/typings/api/list/platforms';
|
import { IPlatformsResponse, IDataPlatform } from 'wherehows-web/typings/api/list/platforms';
|
||||||
import { ApiStatus } from 'wherehows-web/utils/api';
|
|
||||||
import { getJSON } from 'wherehows-web/utils/api/fetcher';
|
import { getJSON } from 'wherehows-web/utils/api/fetcher';
|
||||||
import { getListUrlRoot } from 'wherehows-web/utils/api/list/shared';
|
import { getListUrlRoot } from 'wherehows-web/utils/api/list/shared';
|
||||||
|
|
||||||
@ -13,17 +12,9 @@ const platformsUrl = `${getListUrlRoot('v2')}/platforms`;
|
|||||||
* @returns {Promise<Array<IDataPlatform>>}
|
* @returns {Promise<Array<IDataPlatform>>}
|
||||||
*/
|
*/
|
||||||
const readPlatforms = async (): Promise<Array<IDataPlatform>> => {
|
const readPlatforms = async (): Promise<Array<IDataPlatform>> => {
|
||||||
const { status, platforms = [], msg } = await getJSON<IPlatformsResponse>({ url: platformsUrl });
|
const { platforms = [] } = await getJSON<IPlatformsResponse>({ url: platformsUrl });
|
||||||
|
|
||||||
if (status === ApiStatus.OK) {
|
|
||||||
if (!platforms.length) {
|
|
||||||
throw new Error('No platforms found');
|
|
||||||
}
|
|
||||||
|
|
||||||
return platforms;
|
return platforms;
|
||||||
}
|
|
||||||
|
|
||||||
throw new Error(msg);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export { readPlatforms };
|
export { readPlatforms };
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user