Skip to content

Commit 30adda7

Browse files
committed
removed temporary mock project service mock fallback
1 parent 4447997 commit 30adda7

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/api/templates.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,13 @@ import _ from 'lodash'
55
import { axiosInstance as axios } from './requestInterceptor'
66
import { PROJECTS_API_URL } from '../config/constants'
77

8-
const projectTemplates = require('./templates-json/project-templates.json')
9-
const productTemplates = require('./templates-json/product-templates.json')
10-
118
/**
129
* Get projects metadata (projectTemplates, productTemplates and projectTypes)
1310
*
1411
* @return {Promise} projects metadata (projectTemplates, productTemplates and projectTypes)
1512
*/
1613
export function getProjectsMetadata() {
1714
return axios.get(`${PROJECTS_API_URL}/v4/projects/metadata`)
18-
.catch((err) => {
19-
// temporary mock data if Project Service is unavailable
20-
if (err.message === 'Network Error') {
21-
return {
22-
data: {
23-
result: {
24-
content: {
25-
projectTemplates,
26-
productTemplates,
27-
milestoneTemplates: [],
28-
projectTypes: [],
29-
productCategories: [],
30-
}
31-
}
32-
}
33-
}
34-
}
35-
36-
throw err
37-
})
3815
.then(resp => _.get(resp.data, 'result.content', {}))
3916
}
4017

0 commit comments

Comments
 (0)