Skip to content

Commit

Permalink
Merge pull request #67 from ainize-team/feature/yoojin/request_format
Browse files Browse the repository at this point in the history
Fix request data format
  • Loading branch information
yoojinko authored Oct 31, 2023
2 parents 5424762 + 6242583 commit 65d31f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ export default class Internal {
}

getDataFromServiceRequest(req: Request) {
if(!req.body.valuePath[1] || !req.body.valuePath[3] || !req.body.valuePath[4] || !req.body.value.prompt) {
if(!req.body.valuePath[1] || !req.body.valuePath[3] || !req.body.valuePath[4] || !req.body.value) {
throw new Error("Not from service request");
}
const requestData: request = {
appName: req.body.valuePath[1],
requesterAddress: req.body.auth.addr,
requestKey: req.body.valuePath[4],
requestData: req.body.value.prompt,
requestData: req.body.value,
}
return requestData;
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export enum RESPONSE_STATUS {
};

export type request = {
requestData: string,
requestData: any,
requesterAddress: string,
requestKey: string,
appName: string,
Expand Down

0 comments on commit 65d31f4

Please sign in to comment.