mirror of
https://github.com/oceanprotocol/ens-proxy.git
synced 2024-12-02 05:57:34 +01:00
Updating response for invalid address
This commit is contained in:
parent
e776846c7a
commit
d226949460
@ -9,7 +9,6 @@ export default async function getEnsAddress(
|
||||
const ensName = request.query.name
|
||||
const provider = await getProvider()
|
||||
const address = await provider.resolveName(ensName)
|
||||
if (!address) throw `No address found for ${ensName}`
|
||||
|
||||
response.setHeader('Cache-Control', 'max-age=0, s-maxage=86400')
|
||||
response.status(200).send({ address })
|
||||
|
@ -3,7 +3,7 @@ import { getProvider } from './_utils'
|
||||
|
||||
export async function getEnsTextRecords(
|
||||
ensName: string
|
||||
): Promise<{ key: string; value: string }[]> {
|
||||
): Promise<{ key: string; value: string }[] | null> {
|
||||
const texts = [
|
||||
'url',
|
||||
'avatar',
|
||||
@ -17,7 +17,7 @@ export async function getEnsTextRecords(
|
||||
const records = []
|
||||
const provider = await getProvider()
|
||||
const resolver = await provider.getResolver(ensName)
|
||||
if (!resolver) throw `No text records found for ${ensName}`
|
||||
if (!resolver) return null
|
||||
|
||||
for (let index = 0; index < texts?.length; index++) {
|
||||
const key = texts[index]
|
||||
|
Loading…
Reference in New Issue
Block a user