feat: deals fetch
This commit is contained in:
@ -1,13 +0,0 @@
|
||||
import { useState } from "react";
|
||||
import { BoardSchema } from "@/client";
|
||||
|
||||
const useBoards = () => {
|
||||
const [boards, setBoards] = useState<BoardSchema[]>([]);
|
||||
|
||||
return {
|
||||
boards,
|
||||
setBoards,
|
||||
};
|
||||
};
|
||||
|
||||
export default useBoards;
|
||||
@ -1,37 +0,0 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { DealSchema } from "@/types/DealSchema";
|
||||
|
||||
const useDeals = () => {
|
||||
const [deals, setDeals] = useState<DealSchema[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
const INITIAL_DEALS: DealSchema[] = [
|
||||
{
|
||||
id: 1,
|
||||
name: "Deal 1",
|
||||
lexorank: "0|gggggg:",
|
||||
statusId: 1,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "Deal 2",
|
||||
lexorank: "0|mmmmmm:",
|
||||
statusId: 1,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Deal 3",
|
||||
lexorank: "0|ssssss:",
|
||||
statusId: 2,
|
||||
},
|
||||
];
|
||||
setDeals(INITIAL_DEALS);
|
||||
}, []);
|
||||
|
||||
return {
|
||||
deals,
|
||||
setDeals,
|
||||
};
|
||||
};
|
||||
|
||||
export default useDeals;
|
||||
@ -4,8 +4,7 @@ import { throttle } from "lodash";
|
||||
import { useStatusesContext } from "@/app/deals/contexts/StatusesContext";
|
||||
import useGetNewRank from "@/app/deals/hooks/useGetNewRank";
|
||||
import { getStatusId, isStatusId } from "@/app/deals/utils/statusId";
|
||||
import { StatusSchema } from "@/client";
|
||||
import { DealSchema } from "@/types/DealSchema";
|
||||
import { DealSchema, StatusSchema } from "@/client";
|
||||
import { sortByLexorank } from "@/utils/lexorank";
|
||||
|
||||
type Props = {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { LexoRank } from "lexorank";
|
||||
import { useStatusesContext } from "@/app/deals/contexts/StatusesContext";
|
||||
import { DealSchema } from "@/types/DealSchema";
|
||||
import { DealSchema } from "@/client";
|
||||
import { getNewLexorank, sortByLexorank } from "@/utils/lexorank";
|
||||
|
||||
const useGetNewRank = () => {
|
||||
|
||||
Reference in New Issue
Block a user