(res: http.ServerResponse, url: URL)
| 2331 | } |
| 2332 | |
| 2333 | private async serveSharingTaskList(res: http.ServerResponse, url: URL): Promise<void> { |
| 2334 | if (!this.ctx) return this.jsonResponse(res, { tasks: [], error: "sharing_unavailable" }); |
| 2335 | try { |
| 2336 | const limit = Number(url.searchParams.get("limit") || 40); |
| 2337 | const hub = this.resolveHubConnection(); |
| 2338 | let data: any; |
| 2339 | if (hub) { |
| 2340 | data = await hubRequestJson(hub.hubUrl, hub.userToken, `/api/v1/hub/tasks?limit=${limit}`); |
| 2341 | } else { |
| 2342 | data = await hubListTasks(this.store, this.ctx, { limit }); |
| 2343 | } |
| 2344 | this.jsonResponse(res, { tasks: Array.isArray(data?.tasks) ? data.tasks : [] }); |
| 2345 | } catch (err) { |
| 2346 | this.jsonResponse(res, { tasks: [], error: String(err) }); |
| 2347 | } |
| 2348 | } |
| 2349 | |
| 2350 | private async serveSharingSkillList(res: http.ServerResponse, url: URL): Promise<void> { |
| 2351 | if (!this.ctx) return this.jsonResponse(res, { skills: [], error: "sharing_unavailable" }); |
no test coverage detected