Skip to content

Commit

Permalink
wrap encodeURIComponent to queueName in store methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Worotyński committed Mar 19, 2020
1 parent 06f5ab3 commit d227beb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ui/components/hooks/useStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,32 @@ export const useStore = (basePath: string): Store => {
.then(data => setState({ data, loading: false }))

const promoteJob = (queueName: string) => (job: AppJob) => () =>
fetch(`${basePath}/queues/${queueName}/${job.id}/promote`, {
fetch(`${basePath}/queues/${encodeURIComponent(queueName)}/${job.id}/promote`, {
method: 'put',
}).then(update)

const retryJob = (queueName: string) => (job: AppJob) => () =>
fetch(`${basePath}/queues/${queueName}/${job.id}/retry`, {
fetch(`${basePath}/queues/${encodeURIComponent(queueName)}/${job.id}/retry`, {
method: 'put',
}).then(update)

const retryAll = (queueName: string) => () =>
fetch(`${basePath}/queues/${queueName}/retry`, {
fetch(`${basePath}/queues/${encodeURIComponent(queueName)}/retry`, {
method: 'put',
}).then(update)

const cleanAllDelayed = (queueName: string) => () =>
fetch(`${basePath}/queues/${queueName}/clean/delayed`, {
fetch(`${basePath}/queues/${encodeURIComponent(queueName)}/clean/delayed`, {
method: 'put',
}).then(update)

const cleanAllFailed = (queueName: string) => () =>
fetch(`${basePath}/queues/${queueName}/clean/failed`, {
fetch(`${basePath}/queues/${encodeURIComponent(queueName)}/clean/failed`, {
method: 'put',
}).then(update)

const cleanAllCompleted = (queueName: string) => () =>
fetch(`${basePath}/queues/${queueName}/clean/completed`, {
fetch(`${basePath}/queues/${encodeURIComponent(queueName)}/clean/completed`, {
method: 'put',
}).then(update)

Expand Down

0 comments on commit d227beb

Please sign in to comment.