Skip to content

Commit

Permalink
CORE: test load (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekachxaidze98 authored Nov 20, 2024
1 parent a767e79 commit c91f946
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
8 changes: 1 addition & 7 deletions api/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import apiRequest from './index'
const FileDownload = require('js-file-download')

export const fetchWorks = async (body) => {
const { t } = body
const split = t?.split('-')
const isUndefined = split?.some((item) => item === undefined)
const url = new URL(
`/v3/search/works${!isUndefined || t ? `?t=${t}` : ''}`,
process.env.API_URL
).href
const url = new URL(`/v3/search/works`, process.env.API_URL).href
const { data: dataWorks } = await apiRequest(url, {
body,
method: 'POST',
Expand Down
3 changes: 1 addition & 2 deletions pages/search/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const getServerSideProps = async ({ query: searchParams }) => {
}
// TODO for nice response
// const { q, page = 1, limit = 10, sort = 'recency' } = searchParams
const { q, page = 1, limit = 10, sort = 'relevance', t } = searchParams
const { q, page = 1, limit = 10, sort = 'relevance' } = searchParams

const data = {
currentPage: +page,
Expand All @@ -40,7 +40,6 @@ export const getServerSideProps = async ({ query: searchParams }) => {
q,
offset,
limit,
t,
exclude: ['fullText'],
sort: sort === 'recent' ? 'recency' : sort,
}
Expand Down

0 comments on commit c91f946

Please sign in to comment.