File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/react-native/lib/credentials Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -183,15 +183,20 @@ export function useGetCredentialStatus({ credential }) {
183
183
} , [ status ] ) ;
184
184
}
185
185
186
+ export async function getIssuerEcosystems ( issuer , isTestMode = false ) {
187
+ const API = isTestMode ? "https://api-testnet.dock.io" : "https://api.dock.io" ;
188
+ //TODO: Temporary implementation - Replace API fetch with sdk when sdk implementation
189
+ const response = axios . get ( `${ API } /dids/${ issuer . id } /ecosystems` ) ;
190
+ return ( await response ) . data ?. list
191
+ }
192
+
186
193
export function useEcosystems ( { issuer } ) {
187
194
const { testMode } = useWallet ( ) ;
188
195
const [ ecosystems , setEcosystems ] = useState ( [ ] ) ;
189
196
190
- const API = testMode ? "https://api-testnet.dock.io" : "https://api.dock.io" ;
191
197
useEffect ( ( ) => {
192
- //TODO: Temporary implementation - Replace API fetch with sdk when sdk implementation
193
- axios . get ( `${ API } /dids/${ issuer . id } /ecosystems` ) . then ( result => {
194
- setEcosystems ( result . data ?. list || [ ] ) ;
198
+ getIssuerEcosystems ( issuer , testMode ) . then ( ecosystems => {
199
+ setEcosystems ( ecosystems || [ ] ) ;
195
200
} )
196
201
} , [ issuer . id ] ) ;
197
202
You can’t perform that action at this time.
0 commit comments