|
|
@ -31,7 +31,7 @@ export default resolver.pipe(resolver.zod(GetSearchRequest), async ({ text, page |
|
|
|
|
|
|
|
|
|
|
|
const domainName = (text.replaceAll('.ton','')+'.ton').toLowerCase(); |
|
|
|
const domainName = (text.replaceAll('.ton','')+'.ton').toLowerCase(); |
|
|
|
const result = await Elastic.search({ text, page }) |
|
|
|
const result = await Elastic.search({ text, page }) |
|
|
|
const domain = await db.nftDomain.findFirst({ where:{domainName} }) |
|
|
|
const domain = await db.nftDomain.findFirst({ where:{domainName, available: true} }) |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
hits: result.hits.map((i) => processResult(i._source, text)), |
|
|
|
hits: result.hits.map((i) => processResult(i._source, text)), |
|
|
|