Skip to content

Commit

Permalink
feat(ZNTA-975): remove unused functions
Browse files Browse the repository at this point in the history
These are replaced by new functions in the watchers, since that is
the only place they are used.
  • Loading branch information
davidmason committed Aug 8, 2017
1 parent 9c536b3 commit e2ab82a
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions server/zanata-frontend/src/frontend/app/editor/api/index.js
Expand Up @@ -7,7 +7,6 @@
// (it is just a wrapper around whatwg-fetch)
import fetch from 'isomorphic-fetch'
import { encode } from '../utils/doc-id-util'
import { chain, isEmpty } from 'lodash'
import {
STATUS_UNTRANSLATED,
STATUS_NEEDS_WORK,
Expand Down Expand Up @@ -39,48 +38,6 @@ function getServiceUrl () {
return serviceUrl
}

export function fetchPhraseList (project, version, localeId, docId, filter) {
// FIXME damason check that arguments are all defined
const encodedId = encode(docId)
const queryString = filter ? filterQueryString(filter) : ''
const statusListUrl =
`${baseRestUrl}/project/${project}/version/${version}/doc/${encodedId}/status/${localeId}?${queryString}` // eslint-disable-line max-len

return fetch(statusListUrl, {
credentials: 'include',
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
mode: 'cors'
})
}

export function filterQueryString (advancedFilter) {
return chain(advancedFilter)
.toPairs()
.filter(([key, value]) => !isEmpty(value))
.map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
.join('&')
.value()
}

export function fetchPhraseDetail (localeId, phraseIds) {
const phraseDetailUrl =
`${baseRestUrl}/source+trans/${localeId}?ids=${phraseIds.join(',')}`

return fetch(phraseDetailUrl, {
credentials: 'include',
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
mode: 'cors'
})
}

export function fetchStatistics (_projectSlug, _versionSlug,
_docId, _localeId) {
const statsUrl =
Expand Down

0 comments on commit e2ab82a

Please sign in to comment.