-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ga create mutation func(..ing..)
- Loading branch information
Showing
13 changed files
with
236 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use client' | ||
|
||
import NotFoundErrorFallback from "@/Component/Common/ErrorFallback/NotFoundErrorfallback" | ||
|
||
export default function GlobalNotFound(){ | ||
return <NotFoundErrorFallback /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
'use client'; | ||
import BigQueryCreateForm from '@/Component/Blog/BigQueryCreateForm/BigQueryCreateForm'; | ||
import usePostGAReport from '@/hooks/mutations/usecreateGAReportMutation'; | ||
|
||
export default function GaReportCreatePage() { | ||
return <BigQueryCreateForm></BigQueryCreateForm>; | ||
const { mutate } = usePostGAReport(); | ||
return ( | ||
<BigQueryCreateForm | ||
onSubmit={(type, start, end) => { | ||
mutate({ | ||
type, | ||
startDate: start, | ||
endDate: end, | ||
}); | ||
}} | ||
></BigQueryCreateForm> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { NextRequest, NextResponse } from 'next/server'; | ||
|
||
import { get } from '@/utils/axiosClient'; | ||
import { formatDateToString } from '@/utils/formatDateToString'; | ||
|
||
export async function POST(req: NextRequest) { | ||
const { type, startDate, endDate } = await req.json(); | ||
console.log(startDate, endDate); | ||
switch (type) { | ||
case '총 사용자 수': | ||
return ( | ||
await get( | ||
`/api/active-users?startDate=${formatDateToString( | ||
new Date(startDate) | ||
)}&endDate=${formatDateToString(new Date(endDate))}` | ||
) | ||
).data; | ||
return {}; | ||
case '참여 시간': | ||
return {}; | ||
case '도시별 한 페이지 당 방문 세션 수': | ||
return {}; | ||
case '방문자의 기기 유형(모바일,PC)': | ||
return {}; | ||
} | ||
|
||
return NextResponse.json( | ||
{ type }, | ||
{ | ||
status: 200, | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use client'; | ||
|
||
import { useEffect } from 'react'; | ||
|
||
import * as Sentry from '@sentry/nextjs'; | ||
|
||
import ErrorFallback from '@/Component/Common/ErrorFallback/Errorfallback'; | ||
|
||
export default function GlobalError({ | ||
error, | ||
reset, | ||
}: { | ||
error: Error & { digest?: string }; | ||
reset: () => void; | ||
}) { | ||
useEffect(() => { | ||
Sentry.setContext('Application 에러', { | ||
error, | ||
}); | ||
|
||
Sentry.withScope((scope) => { | ||
scope.setTag('type', 'Application'); | ||
scope.setTag('error-name', error.name); | ||
|
||
Sentry.captureException(error, { | ||
level: 'error', | ||
extra: { | ||
type: 'Application 에러', | ||
...error, | ||
}, | ||
}); | ||
}); | ||
}, []); | ||
return ( | ||
<Sentry.ErrorBoundary> | ||
<ErrorFallback error={error} reset={reset} /> | ||
</Sentry.ErrorBoundary> | ||
); | ||
} |
Oops, something went wrong.