diff --git a/pages/api/auth/[...nextauth].ts b/pages/api/auth/[...nextauth].ts index 428f20b..cfa51b2 100644 --- a/pages/api/auth/[...nextauth].ts +++ b/pages/api/auth/[...nextauth].ts @@ -46,7 +46,7 @@ export default NextAuth({ clientId: process.env.GOOGLE_CLIENT_ID as string, clientSecret: process.env.GOOGLE_CLIENT_SECRET as string, httpOptions: { - timeout: 40000, + timeout: 60000, }, }), FacebookProvider({ diff --git a/pages/dashboard.tsx b/pages/dashboard.tsx index 0387253..e6917f3 100644 --- a/pages/dashboard.tsx +++ b/pages/dashboard.tsx @@ -1,7 +1,7 @@ import type { NextPage } from "next"; -import { Fragment } from "react"; +import { Fragment, useState } from "react"; import { useIntl } from "react-intl"; -import { useQuery, gql } from "@apollo/client"; +import { useQuery } from "@apollo/client"; import toast from "react-hot-toast"; import { TRANSACTION_AMOUNT_AGGREGATE } from "constants/queries"; import { GET_TRANSACTIONS } from "constants/queries"; @@ -13,10 +13,20 @@ import CategoryChart from "components/CategoryChart"; const Dashboard: NextPage = () => { const intl = useIntl(); + const [dateStart, setDateStart] = useState(new Date()); + const [dateEnd, setDateEnd] = useState(new Date()); + const { data: income, error: incomeError } = useQuery( TRANSACTION_AMOUNT_AGGREGATE, { - variables: { filter: { and: [{ amount: { gt: 0 } }] } }, + variables: { + filter: { + and: [ + { amount: { gt: 0 } }, + // { date: { between: { min: dateStart, max: dateEnd } } }, + ], + }, + }, } ); if (incomeError) { diff --git a/server/Dockerfile b/server/Dockerfile index 25d14b5..71def9e 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -54,7 +54,7 @@ ADD ikura.graphql . ADD ikura-prod.graphql . ADD ikura.zefops.py . -RUN pip3 install zef==v0.15.7a3 +RUN pip3 install zef==v0.15.7a7 # pip install stuff ADD requirements.txt . diff --git a/server/ikura-prod.graphql b/server/ikura-prod.graphql index 27de71d..173319d 100644 --- a/server/ikura-prod.graphql +++ b/server/ikura-prod.graphql @@ -38,6 +38,7 @@ type Transaction user: User @relation(rt: "User") category: Category amount: Int @search + description: String date: DateTime @search }