|
|
|
@ -98,7 +98,30 @@ export class Result {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
export async function get_search_results(query: string) { |
|
|
|
|
return Result.fromBackend(await call_api("find/" + query)); |
|
|
|
|
const res = await call_api("find/" + query); |
|
|
|
|
|
|
|
|
|
return res.map((item: any) => ({ |
|
|
|
|
...item, |
|
|
|
|
getRouteParams: () => ({ |
|
|
|
|
domain_init: /* domain up to . */ item.domain.split(".")[0], |
|
|
|
|
domain: /* domain up to . */ item.domain.split(".")[0], |
|
|
|
|
zone: /* domain after . */ item.domain.split(".").slice(1).join("."), |
|
|
|
|
}), |
|
|
|
|
canAuction: () => |
|
|
|
|
item.auction_price !== undefined && |
|
|
|
|
item.auction_price !== null && |
|
|
|
|
item.owner === undefined, |
|
|
|
|
canBuy: () => |
|
|
|
|
item.buy_price !== undefined && |
|
|
|
|
item.buy_price !== null && |
|
|
|
|
item.owner === undefined, |
|
|
|
|
zone: () => item.domain.split(".").slice(1).join("."), |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
// canAuction
|
|
|
|
|
// canBuy
|
|
|
|
|
// zone
|
|
|
|
|
// return {...res, };};
|
|
|
|
|
/*await sleep(200); |
|
|
|
|
return [ |
|
|
|
|
new Result(query + '.ton', 5, 3), |
|
|
|
|