Skip to content

Commit

Permalink
Use existing history fetcher instead of history query endpoint wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Feb 8, 2024
1 parent 6ddaacf commit 1cf5d8b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion client/src/api/histories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ export const deleteHistory = fetcher.path("/api/histories/{history_id}").method(
export const deleteHistories = fetcher.path("/api/histories/batch/delete").method("put").create();
export const undeleteHistory = fetcher.path("/api/histories/deleted/{history_id}/undelete").method("post").create();
export const undeleteHistories = fetcher.path("/api/histories/batch/undelete").method("put").create();
export const historiesQuery = fetcher.path("/api/histories").method("get").create();
export const publishedHistoriesFetcher = fetcher.path("/api/histories/published").method("get").create();
4 changes: 2 additions & 2 deletions client/src/components/Grid/configs/histories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@fortawesome/free-solid-svg-icons";
import { useEventBus } from "@vueuse/core";

import { deleteHistories, deleteHistory, historiesQuery, undeleteHistories, undeleteHistory } from "@/api/histories";
import { deleteHistories, deleteHistory, historiesFetcher, undeleteHistories, undeleteHistory } from "@/api/histories";
import { updateTags } from "@/api/tags";
import { useHistoryStore } from "@/stores/historyStore";
import Filtering, { contains, equals, expandNameTag, toBool, type ValidFilter } from "@/utils/filtering";
Expand All @@ -31,7 +31,7 @@ type SortKeyLiteral = "create_time" | "name" | "update_time" | undefined;
* Request and return data from server
*/
async function getData(offset: number, limit: number, search: string, sort_by: string, sort_desc: boolean) {
const { data, headers } = await historiesQuery({
const { data, headers } = await historiesFetcher({
limit,
offset,
search,
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Grid/configs/historiesShared.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { faEye } from "@fortawesome/free-solid-svg-icons";
import { useEventBus } from "@vueuse/core";

import { historiesQuery } from "@/api/histories";
import { historiesFetcher } from "@/api/histories";
import { updateTags } from "@/api/tags";
import Filtering, { contains, expandNameTag, type ValidFilter } from "@/utils/filtering";
import _l from "@/utils/localization";
Expand All @@ -21,7 +21,7 @@ type SortKeyLiteral = "create_time" | "name" | "update_time" | undefined;
* Request and return data from server
*/
async function getData(offset: number, limit: number, search: string, sort_by: string, sort_desc: boolean) {
const { data, headers } = await historiesQuery({
const { data, headers } = await historiesFetcher({
limit,
offset,
search,
Expand Down

0 comments on commit 1cf5d8b

Please sign in to comment.