Skip to content

Commit

Permalink
added constant
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Jan 21, 2020
1 parent 0ed386a commit 266fa99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions x-pack/legacy/plugins/uptime/common/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
*/

export const UNNAMED_LOCATION = 'Unnamed-location';

export const UPTIME_INDEX_PATTERN = 'heartbeat-8*';
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/

import { UMSavedObjectsAdapter } from './types';
import uptimeIndexPattern from './heartbeat_index_pattern.json';
import { UPTIME_INDEX_PATTERN } from '../../../../common/constants';

export const savedObjectsAdapter: UMSavedObjectsAdapter = {
getUptimeIndexPattern: async client => {
try {
return await client.get('index-pattern', uptimeIndexPattern.id);
return await client.get('index-pattern', UPTIME_INDEX_PATTERN);
} catch (error) {
return await client.create(
'index-pattern',
Expand All @@ -19,7 +19,7 @@ export const savedObjectsAdapter: UMSavedObjectsAdapter = {
title: 'heartbeat-8*',
fields: '[]',
},
{ id: uptimeIndexPattern.id, overwrite: false }
{ id: UPTIME_INDEX_PATTERN, overwrite: false }
);
}
},
Expand Down

0 comments on commit 266fa99

Please sign in to comment.