Browse Source

fixed results getting & added checking for bought domain

master
Aleksandr Bautin 10 months ago
parent
commit
b1e3658eb7
No known key found for this signature in database
GPG Key ID: 9B3364A12DFE9211
  1. 25
      src/result.ts
  2. 7
      src/views/Checkout.vue

25
src/result.ts

@ -98,7 +98,30 @@ export class Result {
// } // }
export async function get_search_results(query: string) { 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); /*await sleep(200);
return [ return [
new Result(query + '.ton', 5, 3), new Result(query + '.ton', 5, 3),

7
src/views/Checkout.vue

@ -75,6 +75,13 @@ export default {
params: { domain_init: this.domain, zone: this.zone }, params: { domain_init: this.domain, zone: this.zone },
}); });
} }
let res = await get_domain_result(this.domain + "." + this.zone);
while (res.owner !== this.$store.getters.address) {
res = await get_domain_result(this.domain + "." + this.zone);
}
this.$router.push({ this.$router.push({
name: "Explore", name: "Explore",
params: { domain: this.domain + "." + this.zone }, params: { domain: this.domain + "." + this.zone },

Loading…
Cancel
Save