From 2db30810a3f708c50f2002106380285d3d1c5abb Mon Sep 17 00:00:00 2001 From: mohandast52 Date: Thu, 4 Apr 2024 13:46:11 +0530 Subject: [PATCH] minor changes --- .../autonolas-registry/components/ListAgents/details.jsx | 6 +++--- .../components/ListAgents/useAgents.jsx | 9 ++------- apps/autonolas-registry/components/ListAgents/utils.jsx | 8 ++++---- .../components/ListComponents/details.jsx | 6 +++--- .../components/ListComponents/useComponents.jsx | 9 ++------- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/apps/autonolas-registry/components/ListAgents/details.jsx b/apps/autonolas-registry/components/ListAgents/details.jsx index 4f4ca1e3..2b94ba0c 100644 --- a/apps/autonolas-registry/components/ListAgents/details.jsx +++ b/apps/autonolas-registry/components/ListAgents/details.jsx @@ -1,8 +1,8 @@ +import { useCallback } from 'react'; import { useRouter } from 'next/router'; -import Details from 'common-util/Details'; -import { useHelpers } from 'common-util/hooks'; -import { useCallback } from 'react'; +import Details from '../../common-util/Details'; +import { useHelpers } from '../../common-util/hooks'; import { getAgentDetails, updateAgentHashes, diff --git a/apps/autonolas-registry/components/ListAgents/useAgents.jsx b/apps/autonolas-registry/components/ListAgents/useAgents.jsx index 392e69f7..6ebe70c3 100644 --- a/apps/autonolas-registry/components/ListAgents/useAgents.jsx +++ b/apps/autonolas-registry/components/ListAgents/useAgents.jsx @@ -56,8 +56,8 @@ export const useMyAgents = () => { first: ${TOTAL_VIEW_COUNT}, skip: ${TOTAL_VIEW_COUNT * (currentPage - 1)}, where: { - owner: "${ownerAddress}", packageType: agent + owner_contains_nocase: "${ownerAddress}", }, orderBy: tokenId, ) ${columnsForAgentsAndComponents} @@ -117,12 +117,7 @@ const useMyAgentsBySearch = () => { and: [ { packageType: "agent" } { owner_contains_nocase: "${ownerAddress}" } - { - or: [ - { publicId_contains_nocase: "${searchValue}" } - { packageHash_contains_nocase: "${searchValue}" } - ] - } + ${getSearchFilterSubQueryForAgentsAndComponents(searchValue)} ] } orderBy: tokenId diff --git a/apps/autonolas-registry/components/ListAgents/utils.jsx b/apps/autonolas-registry/components/ListAgents/utils.jsx index b9a13316..4f951051 100644 --- a/apps/autonolas-registry/components/ListAgents/utils.jsx +++ b/apps/autonolas-registry/components/ListAgents/utils.jsx @@ -1,7 +1,7 @@ -import { getMechMinterContract, getAgentContract } from 'common-util/Contracts'; -import { getFirstAndLastIndex } from 'common-util/List/functions'; -import { getListByAccount } from 'common-util/ContractUtils/myList'; -import { sendTransaction } from 'common-util/functions'; +import { getMechMinterContract, getAgentContract } from '../../common-util/Contracts'; +import { getFirstAndLastIndex } from '../../common-util/List/functions'; +import { getListByAccount } from '../../common-util/ContractUtils/myList'; +import { sendTransaction } from '../../common-util/functions'; // --------- HELPER METHODS --------- export const getAgentOwner = async (agentId) => { diff --git a/apps/autonolas-registry/components/ListComponents/details.jsx b/apps/autonolas-registry/components/ListComponents/details.jsx index 5c696810..423e8df4 100644 --- a/apps/autonolas-registry/components/ListComponents/details.jsx +++ b/apps/autonolas-registry/components/ListComponents/details.jsx @@ -1,8 +1,8 @@ +import { useCallback } from 'react'; import { useRouter } from 'next/router'; -import Details from 'common-util/Details'; -import { useHelpers } from 'common-util/hooks'; -import { useCallback } from 'react'; +import Details from '../../common-util/Details'; +import { useHelpers } from '../../common-util/hooks'; import { getComponentDetails, updateComponentHashes, diff --git a/apps/autonolas-registry/components/ListComponents/useComponents.jsx b/apps/autonolas-registry/components/ListComponents/useComponents.jsx index 6cda919e..55ce9263 100644 --- a/apps/autonolas-registry/components/ListComponents/useComponents.jsx +++ b/apps/autonolas-registry/components/ListComponents/useComponents.jsx @@ -59,8 +59,8 @@ export const useMyComponents = () => { first: ${TOTAL_VIEW_COUNT}, skip: ${TOTAL_VIEW_COUNT * (currentPage - 1)}, where: { - owner: "${ownerAddress}", ${componentPackageType} + owner_contains_nocase: "${ownerAddress}", }, orderBy: tokenId, ) ${columnsForAgentsAndComponents} @@ -120,12 +120,7 @@ const useMyComponentsBySearch = () => { and: [ { ${componentPackageType} } { owner_contains_nocase: "${ownerAddress}" } - { - or: [ - { publicId_contains_nocase: "${searchValue}" } - { packageHash_contains_nocase: "${searchValue}" } - ] - } + ${getSearchFilterSubQueryForAgentsAndComponents(searchValue)} ] } orderBy: tokenId