File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,10 +7,13 @@ import Gallery from "@/components/ClubPageComponents/Gallery";
77import OurSchedule from "@/components/ClubPageComponents/OurSchedule" ;
88import { clubCodes } from "@/lib/utils" ;
99import { getClubDetails } from "../actions/ClubData" ;
10+ import { redirect } from "next/navigation" ;
1011
1112export async function generateMetadata ( { params, searchParams } , parent ) {
1213 const club = ( await params ) . clubname ;
13- const clubName = ( await getClubDetails ( club ) ) . name ;
14+ const clubDetails = await getClubDetails ( club )
15+ if ( ! clubDetails ) redirect ( "/" ) ;
16+ const clubName = clubDetails . name ;
1417 // console.log(await parent);
1518 return {
1619 title : `${ clubName } | ${ ( await parent ) . title . absolute } ` ,
Original file line number Diff line number Diff line change 22import Link from "next/link" ;
33import { updateClubData } from "@/app/actions/ClubActions" ;
44import { useFormState } from "react-dom" ;
5- import { UploadButton } from "@uploadthing/react" ;
5+ import { generateUploadButton } from "@uploadthing/react" ;
6+ const UploadButton = generateUploadButton ( {
7+ url : "/bost/api/uploadthing"
8+ } )
69import { useEffect , useState } from "react" ;
710
811export default function Form ( { clubData } ) {
@@ -96,6 +99,7 @@ export default function Form({ clubData }) {
9699 < UploadButton
97100 endpoint = "imageUploader"
98101 className = "ut-uploading:pointer-events-none"
102+ callbackUrl
99103 appearance = { {
100104 container : "w-1/4" ,
101105button :"bg-primary" } }
Original file line number Diff line number Diff line change 22import Link from "next/link" ;
33import { addImage } from "@/app/actions/GalleryActions" ; // Assume this is your server action
44import { useFormState } from "react-dom" ;
5- import { UploadButton } from "@uploadthing/react" ;
5+ import { generateUploadButton } from "@uploadthing/react" ;
6+ const UploadButton = generateUploadButton ( {
7+ url : "/bost/api/uploadthing"
8+ } )
69import { useState } from "react" ;
710
811export default function AddImageForm ( ) {
Original file line number Diff line number Diff line change 22import Link from "next/link" ;
33import { updateGalleryImageURL } from "@/app/actions/GalleryActions" ;
44import { useFormState } from "react-dom" ;
5- import { UploadButton } from "@uploadthing/react" ;
5+ import { generateUploadButton } from "@uploadthing/react" ;
6+ const UploadButton = generateUploadButton ( {
7+ url : "/bost/api/uploadthing"
8+ } )
69import { useState } from "react" ;
710
811export default function EditImageForm ( { url, name } ) {
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ import { Button } from "@/components/ui/button";
44import Link from "next/link" ;
55import { useFormState } from "react-dom" ;
66import { createProject } from "@/app/actions/ProjectActions" ;
7- import { UploadButton } from "@uploadthing/react" ;
7+ import { generateUploadButton } from "@uploadthing/react" ;
8+ const UploadButton = generateUploadButton ( {
9+ url : "/bost/api/uploadthing"
10+ } )
811
912const developmentStatus = [
1013 { id : 1 , name : "Not Started" } ,
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ import { Button } from "@/components/ui/button";
44import Link from "next/link" ;
55import DynamicField from "@/components/ui/dynamic-input-field" ;
66import { useFormState } from "react-dom" ;
7- import { UploadButton } from "@uploadthing/react" ;
7+ import { generateUploadButton } from "@uploadthing/react" ;
8+ const UploadButton = generateUploadButton ( {
9+ url : "/bost/api/uploadthing"
10+ } )
811import { updateProject } from "@/app/actions/ProjectActions" ;
912
1013const developmentStatus = [
Original file line number Diff line number Diff line change 22import Link from "next/link" ;
33import { createTeamMember } from "@/app/actions/TeamActions" ;
44import { useFormState } from "react-dom" ;
5- import { UploadButton } from "@uploadthing/react" ;
5+ import { generateUploadButton } from "@uploadthing/react" ;
6+ const UploadButton = generateUploadButton ( {
7+ url : "/bost/api/uploadthing"
8+ } )
69import { useState } from "react" ;
710import { Button } from "../ui/button" ;
811
Original file line number Diff line number Diff line change 22import Link from "next/link" ;
33import { updateTeamMember } from "@/app/actions/TeamActions" ;
44import { useFormState } from "react-dom" ;
5- import { UploadButton } from "@uploadthing/react" ;
5+ import { generateUploadButton } from "@uploadthing/react" ;
6+ const UploadButton = generateUploadButton ( {
7+ url : "/bost/api/uploadthing"
8+ } )
69import { useState } from "react" ;
710
811export default function Form ( { memberDetails } ) {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export async function middleware(request) {
66 const session = await auth ( ) ;
77 const isAuthenticated = session ?. user ;
88 if ( nextUrl . pathname . startsWith ( "/dashboard" ) && ! isAuthenticated ) {
9- return NextResponse . redirect ( new URL ( "/" , request . url ) ) ;
9+ return NextResponse . redirect ( new URL ( "/bost/ " , request . url ) ) ;
1010 }
1111}
1212
You can’t perform that action at this time.
0 commit comments