Skip to content

Commit

Permalink
feat: remove legacy api endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Oct 9, 2023
1 parent f6ae905 commit 14e4fd3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 deletions.
3 changes: 0 additions & 3 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ export class Api {
const trimedPath = trim(path, '/')
return this.sendActionAsText(`/api/task/batchUpdate/index/${trimedPath}`, { method: Method.POST, data })
}
runBatchSearch() {
return this.sendAction('/api/task/batchSearch', { method: Method.POST })
}
runBatchDownload(options) {
return this.sendAction('/api/task/batchDownload', { method: Method.POST, data: { options } })
}
Expand Down
14 changes: 1 addition & 13 deletions src/components/BatchSearchCopyForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,11 @@ export default {
}
},
methods: {
async runBatchSearch() {
try {
await this.$store.dispatch('indexing/runBatchSearch')
this.$root.$bvToast.toast(this.$t('batchSearch.success'), { noCloseButton: true, variant: 'success' })
} catch (_) {
this.$root.$bvToast.toast(this.$t('batchSearch.error'), { noCloseButton: true, variant: 'danger' })
}
},
async copyBatchSearch() {
try {
const { uuid: batchId } = this.batchSearch
await this.$core.api.copyBatchSearch(batchId, this.name, this.description)
if (!this.isServer) {
this.runBatchSearch()
} else {
this.$root.$bvToast.toast(this.$t('batchSearch.submitSuccess'), { noCloseButton: true, variant: 'success' })
}
this.$root.$bvToast.toast(this.$t('batchSearch.submitSuccess'), { noCloseButton: true, variant: 'success' })
if (this.deleteAfterRelaunch) {
await this.$store.dispatch('batchSearch/deleteBatchSearch', { batchId })
}
Expand Down
3 changes: 0 additions & 3 deletions src/store/modules/indexing.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ function actionsBuilder(api) {
}
return api.index(state.form)
},
runBatchSearch() {
return api.runBatchSearch()
},
submitFindNamedEntities({ state }) {
const defaultProject = state.form.defaultProject ?? null
const options = { syncModels: !state.form.offline, defaultProject }
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/specs/components/BatchSearchCopyForm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ describe('BatchSearchCopyForm.vue', () => {
beforeAll(() => {
Murmur.config.merge({ mode: 'SERVER' })
const api = {
copyBatchSearch: jest.fn(),
runBatchSearch: jest.fn()
copyBatchSearch: jest.fn()
}
const core = Core.init(createLocalVue(), api).useAll()
i18n = core.i18n
Expand Down

0 comments on commit 14e4fd3

Please sign in to comment.