diff --git a/src/components/SearchNamesTable.vue b/src/components/SearchNamesTable.vue
index 051b298b2..6ebbc2f6a 100644
--- a/src/components/SearchNamesTable.vue
+++ b/src/components/SearchNamesTable.vue
@@ -25,7 +25,7 @@
{{ name.name }}
-
{{ name.status }} |
+ {{ name.active ? 'Active' : 'Expired' }} |
diff --git a/src/components/SearchNamesTableCondensed.vue b/src/components/SearchNamesTableCondensed.vue
index 5f53734f6..6a390778a 100644
--- a/src/components/SearchNamesTableCondensed.vue
+++ b/src/components/SearchNamesTableCondensed.vue
@@ -30,7 +30,7 @@
- {{ name.status }}
+ {{ name.active ? 'Active' : 'Expired' }}
|
diff --git a/src/stores/search.js b/src/stores/search.js
index f5822eab7..ed3a121d5 100644
--- a/src/stores/search.js
+++ b/src/stores/search.js
@@ -6,21 +6,15 @@ export const useSearchStore = defineStore('search', () => {
const { MIDDLEWARE_URL } = useRuntimeConfig().public
const axios = useAxios()
- const rawNamesResults = ref([])
+ const namesResults = ref([])
const tokensResults = ref([])
const nftsResults = ref([])
- const namesResults = computed(() => {
- return rawNamesResults.value
- ? adaptNamesResults(rawNamesResults.value)
- : null
- })
-
async function fetchNamesResults({ query, limit, queryParameters } = {}) {
- rawNamesResults.value = null
- const defaultParameters = `/v2/names/search?prefix=${query}&limit=${limit ?? 10}&direction=forward`
+ namesResults.value = null
+ const defaultParameters = `/v3/names?prefix=${query}&limit=${limit ?? 10}&by=name`
const { data } = await axios.get(`${MIDDLEWARE_URL}${queryParameters || defaultParameters}`)
- rawNamesResults.value = data
+ namesResults.value = data
}
async function fetchTokenResults({ query, limit, queryParameters } = {}) {
diff --git a/src/utils/adapters.js b/src/utils/adapters.js
index 3d0648e8e..de7573551 100644
--- a/src/utils/adapters.js
+++ b/src/utils/adapters.js
@@ -8,7 +8,6 @@ import {
formatDecodeBase64,
formatIsAuction,
formatNameState,
- formatNameStatus,
formatTemplateLimit,
formatTokenLimit,
} from '@/utils/format'
@@ -568,22 +567,6 @@ export function adaptStateChannels(stateChannels) {
}
}
-export function adaptNamesResults(names) {
- const formattedData = names.data
- .map(name => {
- return {
- name: name.payload.name,
- status: formatNameStatus(name),
- }
- })
-
- return {
- next: names.next,
- data: formattedData,
- prev: names.prev,
- }
-}
-
export function adaptNftTransfers(transfers) {
const formattedData = transfers.data
.map(transfer => {
diff --git a/src/utils/format.js b/src/utils/format.js
index 751500642..156a7f0b4 100644
--- a/src/utils/format.js
+++ b/src/utils/format.js
@@ -96,16 +96,6 @@ export function formatDecodeByteArray(bytesArray) {
return String.fromCharCode(...bytesArray)
}
-export function formatNameStatus(name) {
- if (name.payload.auctionEnd) {
- return 'In Auction'
- } else if (name.payload.active) {
- return 'Active'
- } else {
- return 'Expired'
- }
-}
-
export function formatNameState(name, blockHeight) {
const isInAuction = name.status === 'auction'
const isActive = name.active