Skip to content

Commit

Permalink
feat: add order parameter in events get request
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsp45 committed Dec 6, 2023
1 parent f30950c commit c0256f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/app/hooks/events/useEvents.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useQuery } from "react-query";
import { API } from "bokkenjs";

export function useEvents() {
export function useEvents(order: string) {
return useQuery("events", async () => {
const {
data: { data: events },
} = await API.get("/api/events");
} = await API.get("/api/events", {params: {order: order}});

return events;
});
Expand Down
2 changes: 1 addition & 1 deletion apps/app/pages/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import styles from "~/styles/Dashboard.module.css";
const { Title } = Typography;

function Events() {
const { data: events, isLoading } = useEvents();
const { data: events, isLoading } = useEvents('desc');

return (
<AppLayout>
Expand Down

0 comments on commit c0256f0

Please sign in to comment.