Filter by arbitrary attributes #40
@ -44,18 +44,9 @@ export const handler = async (argv: Arguments) => {
|
||||
|
||||
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
|
||||
let result: any[];
|
||||
try {
|
||||
result = await registry.queryRecords({...filters, type, name}, all as boolean);
|
||||
} catch (e) {
|
||||
// https://git.vdb.to/cerc-io/laconicd/issues/118
|
||||
if (Array.isArray(e) && (e as []).length && e[0].message?.includes("store doesn't have key")) {
|
||||
result = [];
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
let result = await registry.queryRecords({...filters, type, name}, all as boolean);
|
||||
|
||||
// Apply ex post filters.
|
||||
if (bondId) {
|
||||
result = result.filter(v => v.bondId === bondId);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user