Updated
This commit is contained in:
@@ -5,11 +5,11 @@ import { API_ENDPOINTS, QUERY_KEYS } from "~/constants";
|
||||
|
||||
// types
|
||||
|
||||
export type GetArticlesResponse = ApiPaginated<UserComment>;
|
||||
export type GetArticlesResponse = ApiPaginated<Article>;
|
||||
|
||||
const useGetArticles = (
|
||||
page: Ref<number>,
|
||||
search: Ref<string>
|
||||
search?: Ref<string>
|
||||
) => {
|
||||
|
||||
// state
|
||||
@@ -23,7 +23,7 @@ const useGetArticles = (
|
||||
params: {
|
||||
offset: (page.value * 10) - 10,
|
||||
limit: 10,
|
||||
search: search.value.length > 0 ? search.value : undefined,
|
||||
search: search ? (search.value.length > 0 ? search.value : undefined) : undefined,
|
||||
}
|
||||
});
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user