Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use task properties for filtering #364

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export class Api {
deleteDoneTasks() {
return this.sendAction('/api/task/clean', { method: Method.POST })
}
getTasks(filter) {
return this.sendAction('/api/task/all', { params: { filter } })
getTasks(filters) {
return this.sendAction('/api/task/all', { params: filters })
}
createIndex(index) {
return this.sendActionAsText(`/api/index/${index}`, { method: Method.PUT })
Expand Down
2 changes: 1 addition & 1 deletion src/pages/TaskBatchDownloadList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default {
},
async getDownloadTasks() {
try {
const tasks = await this.$core.api.getTasks('BatchDownloadRunner')
const tasks = await this.$core.api.getTasks({ name: 'BatchDownloadRunner' })
this.tasks = this.sortByDateTime(tasks)
} catch (e) {
// hot fix to prevent showing endless loading placeholders
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/specs/pages/TaskBatchDownloadList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe('TaskBatchDownloadList.vue', () => {
await wrapper.vm.getDownloadTasks()

expect(api.getTasks).toBeCalledTimes(2) // 1 on mount and 1 in the getDownloadTasks
expect(api.getTasks).toBeCalledWith('BatchDownloadRunner')
expect(api.getTasks).toBeCalledWith({ name: 'BatchDownloadRunner' })
})

it('should display a list of batch download tasks', async () => {
Expand Down