Skip to content

Commit 4d8f95e

Browse files
Update router-quickstart-javascript.md
1 parent b0ef90e commit 4d8f95e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

articles/communication-services/quickstarts/router/includes/router-quickstart-javascript.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,12 @@ const job = await routerClient.createJob("job-1", {
126126
Now, we create a worker to receive work from that queue, with a label of `Some-Skill` equal to 11 and capacity on `my-channel`.
127127

128128
```javascript
129-
const worker = await routerClient.createWorker("worker-1", {
129+
let worker = await routerClient.createWorker("worker-1", {
130130
totalCapacity: 1,
131-
queueAssignments: { [queue.id]: {} },
131+
queueIds: { [queue.id]: {} },
132132
labels: { "Some-Skill": 11 },
133-
channelConfigurations: { "voice": { capacityCostPerJob: 1 } }
133+
channelConfigurations: { "voice": { capacityCostPerJob: 1 } },
134+
availableForOffers: true
134135
});
135136
```
136137

@@ -174,6 +175,15 @@ await routerClient.closeJob("job-1", accept.assignmentId, { dispositionCode: "Re
174175
console.log(`Worker ${worker.id} has closed job ${accept.jobId}`);
175176
```
176177

178+
## Delete the job
179+
180+
Once the job has been closed, we can delete the job so that we can re-create the job with the same ID if we run this sample again
181+
182+
```javascript
183+
await routerClient.deleteJob(accept.jobId);
184+
console.log(`Deleting job ${accept.jobId}`);
185+
```
186+
177187
## Run the code
178188

179189
To run the code, make sure you are on the directory where your `index.js` file is.

0 commit comments

Comments
 (0)