Skip to content

Commit

Permalink
feat(api): allow providing bypassFilter when manually enqueing a bu…
Browse files Browse the repository at this point in the history
…ndle
  • Loading branch information
dtfiedler committed Jan 24, 2025
1 parent ffd0dc8 commit c57b4fd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/routes/ar-io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,18 @@ arIoRouter.post(
express.json(),
async (req, res) => {
try {
const { id } = req.body;
const { id, bypassFilter = true } = req.body;

if (id === undefined) {
res.status(400).send("Must provide 'id'");
return;
}

if (bypassFilter !== undefined && typeof bypassFilter !== 'boolean') {
res.status(400).send("'bypassFilter' must be a boolean");
return;
}

if (await system.bundleDataImporter.isQueueFull()) {
res.status(429).send('Bundle importer queue is full');
return;
Expand All @@ -218,7 +223,7 @@ arIoRouter.post(
const queuedBundle = await system.queueBundle(
{ id, root_tx_id: id } as NormalizedDataItem | PartialJsonTransaction,
true,
true,
bypassFilter,
);

if (queuedBundle.error !== undefined) {
Expand Down

0 comments on commit c57b4fd

Please sign in to comment.