This repository was archived by the owner on Mar 17, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
app/(basenames)/api/basenames/talentprotocol/[address]
src/components/Basenames/UsernameProfileSectionBadges/hooks Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export async function GET(
1313
1414 try {
1515 const response = await fetch (
16- `https://api.talentprotocol.com/api/v2/passports/ ${ encodeURIComponent ( address ) } ` ,
16+ `https://api.talentprotocol.com/score?id= ${ encodeURIComponent ( address ) } ` ,
1717 {
1818 method : 'GET' ,
1919 headers : {
Original file line number Diff line number Diff line change 11import { useQuery } from '@tanstack/react-query' ;
22
3- async function fetchPassport ( address : `0x${string } `) : Promise < Data > {
3+ async function fetchScore ( address : `0x${string } `) : Promise < Data > {
44 const response = await fetch ( `/api/basenames/talentprotocol/${ address } ` ) ;
55 const data = ( await response . json ( ) ) as Data ;
66 return data ;
77}
88
99type Data = {
10- passport : {
11- score : number ;
10+ score : {
11+ points : number ;
12+ v1_score : number ;
1213 } ;
1314 error ?: string ;
1415} ;
1516
1617export function useTalentProtocol ( address ?: `0x${string } `) {
1718 const query = useQuery < Data > ( {
1819 queryKey : [ 'talent-protocol' , address ] ,
19- queryFn : async ( { queryKey } ) => fetchPassport ( queryKey [ 1 ] as `0x${string } `) ,
20+ queryFn : async ( { queryKey } ) => fetchScore ( queryKey [ 1 ] as `0x${string } `) ,
2021 enabled : ! ! address ,
2122 } ) ;
2223
2324 if ( query . data ) {
2425 if ( query . data . error ) {
2526 return undefined ;
2627 }
27-
28- return query . data . passport . score ;
28+ return query . data . score . points ;
2929 }
3030
3131 return undefined ;
You can’t perform that action at this time.
0 commit comments