Skip to content

Commit

Permalink
fix request handling using openapi-fetch 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tuler committed Apr 6, 2024
1 parent 230f190 commit 1f556f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-bears-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@deroll/app": patch
---

fix request handling using openapi-fetch 0.9
12 changes: 6 additions & 6 deletions packages/app/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,21 @@ export class AppImpl implements App {
async start() {
let status: RequestHandlerResult = "accept";
while (true) {
const { response } = await this.POST("/finish", {
const { data, response } = await this.POST("/finish", {
body: { status },
parseAs: "text",
});
if (response.status == 200) {
const data = (await response.json()) as RollupsRequest;
switch (data.request_type) {
if (response.status == 200 && data) {
const request = JSON.parse(data) as RollupsRequest;
switch (request.request_type) {
case "advance_state":
status = await this.handleAdvance(
data.data as AdvanceRequestData,
request.data as AdvanceRequestData,
);
break;
case "inspect_state":
await this.handleInspect(
data.data as InspectRequestData,
request.data as InspectRequestData,
);
break;
}
Expand Down

0 comments on commit 1f556f4

Please sign in to comment.