From 77c0dfaad54b5ec9794128a3019d923102d3c2a5 Mon Sep 17 00:00:00 2001 From: Lautaro Petaccio <1120791+LautaroPetaccio@users.noreply.github.com> Date: Fri, 9 Aug 2024 11:35:27 -0300 Subject: [PATCH] feat: Add isApproved to the ThirdParty endpoint (#763) * feat: Add isApproved to the ThirdParty endpoitng * fix: Tests * fix: Types --- spec/mocks/collections.ts | 1 + src/ThirdParty/ThirdParty.router.spec.ts | 2 ++ src/ThirdParty/utils.spec.ts | 4 ++++ src/ethereum/api/fragments.ts | 2 ++ 4 files changed, 9 insertions(+) diff --git a/spec/mocks/collections.ts b/spec/mocks/collections.ts index c3424c85..b0bf839e 100644 --- a/spec/mocks/collections.ts +++ b/spec/mocks/collections.ts @@ -64,6 +64,7 @@ export const thirdPartyFragmentMock: ThirdPartyFragment = { id: dbTPCollectionMock.third_party_id, root: 'aRoot', managers: [wallet.address], + isApproved: true, maxItems: '10', metadata: { type: ThirdPartyMetadataType.THIRD_PARTY_V1, diff --git a/src/ThirdParty/ThirdParty.router.spec.ts b/src/ThirdParty/ThirdParty.router.spec.ts index 092e622d..5a9f80c3 100644 --- a/src/ThirdParty/ThirdParty.router.spec.ts +++ b/src/ThirdParty/ThirdParty.router.spec.ts @@ -32,6 +32,7 @@ describe('ThirdParty router', () => { { id: '1', root: 'aRoot', + isApproved: true, managers: ['0x1'], maxItems: '3', metadata, @@ -39,6 +40,7 @@ describe('ThirdParty router', () => { { id: '2', root: 'anotherRoot', + isApproved: true, managers: ['0x2', '0x3'], maxItems: '2', metadata, diff --git a/src/ThirdParty/utils.spec.ts b/src/ThirdParty/utils.spec.ts index 23883e88..a41ae6e9 100644 --- a/src/ThirdParty/utils.spec.ts +++ b/src/ThirdParty/utils.spec.ts @@ -15,6 +15,7 @@ describe('toThirdParty', () => { root: 'aRoot', managers: ['0x1', '0x2'], maxItems: '1', + isApproved: true, metadata: { type: ThirdPartyMetadataType.THIRD_PARTY_V1, thirdParty: { @@ -34,6 +35,7 @@ describe('toThirdParty', () => { root: fragment.root, managers: fragment.managers, maxItems: fragment.maxItems, + isApproved: true, name: name, description: description, contracts: [{ network: 'amoy', address: '0x0' }], @@ -51,6 +53,7 @@ describe('toThirdParty', () => { root: 'aRoot', managers: ['0x2'], maxItems: '2', + isApproved: true, metadata: { type: ThirdPartyMetadataType.THIRD_PARTY_V1, thirdParty: null, @@ -64,6 +67,7 @@ describe('toThirdParty', () => { root: fragment.root, managers: fragment.managers, maxItems: fragment.maxItems, + isApproved: fragment.isApproved, name: '', description: '', contracts: [], diff --git a/src/ethereum/api/fragments.ts b/src/ethereum/api/fragments.ts index dcaff0da..60b9aa53 100644 --- a/src/ethereum/api/fragments.ts +++ b/src/ethereum/api/fragments.ts @@ -54,6 +54,7 @@ export const thirdPartyFragment = () => gql` root managers maxItems + isApproved metadata { type thirdParty { @@ -168,6 +169,7 @@ export type CollectionFragment = { export type ThirdPartyFragment = { id: string root: string + isApproved: boolean managers: string[] maxItems: string metadata: ThirdPartyMetadata