Skip to content

Commit

Permalink
fix: path
Browse files Browse the repository at this point in the history
  • Loading branch information
akastercomcom committed Jan 30, 2024
1 parent 99abbf1 commit ba53f43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/middlewares/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export default class Middleware {
blockchainTriggerFilter = async (req: Request, res: Response, next: NextFunction) => {
//check if request is from blockchain trigger
const { triggerPath, triggerValue, txHash } = extractTriggerDataFromRequest(req);
if(!triggerPath || !triggerValue || !txHash) {
res.send("not from blockChain");
return;
}
const result = await this.ain.getValue(triggerPath);
// if request is first reque st, set cache
if (this.cache.get(txHash) && this.cache.get(txHash) !== "error") {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const extractTriggerDataFromRequest = (req:Request) => {
const triggerData = {
triggerPath: path,
triggerValue: req.body.value,
txHash: req.body.txhash,
txHash: req.body.transaction.hash,
}
return triggerData
}
Expand Down

0 comments on commit ba53f43

Please sign in to comment.