fix question request schema encoding
Decode pending question requests through the Schema.Class constructor path so the HttpApi list endpoint returns valid Question.Request instances while keeping QuestionID as a newtype.
This commit is contained in:
parent
0f86a4ebfe
commit
dd34bd8203
1 changed files with 2 additions and 2 deletions
|
|
@ -161,12 +161,12 @@ export namespace Question {
|
||||||
log.info("asking", { id, questions: input.questions.length })
|
log.info("asking", { id, questions: input.questions.length })
|
||||||
|
|
||||||
const deferred = yield* Deferred.make<ReadonlyArray<Answer>, RejectedError>()
|
const deferred = yield* Deferred.make<ReadonlyArray<Answer>, RejectedError>()
|
||||||
const info: Request = {
|
const info = Schema.decodeUnknownSync(Request)({
|
||||||
id,
|
id,
|
||||||
sessionID: input.sessionID,
|
sessionID: input.sessionID,
|
||||||
questions: input.questions,
|
questions: input.questions,
|
||||||
tool: input.tool,
|
tool: input.tool,
|
||||||
}
|
})
|
||||||
pending.set(id, { info, deferred })
|
pending.set(id, { info, deferred })
|
||||||
yield* bus.publish(Event.Asked, info)
|
yield* bus.publish(Event.Asked, info)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue