-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CIT-34] Allow organizers to edit events they've created (#43)
* finished org edit * Trigger build --------- Co-authored-by: Ishaan <[email protected]>
- Loading branch information
1 parent
ef8530d
commit f732a98
Showing
2 changed files
with
14 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import EditEvent from "@/components/EditEvent"; | ||
import { getServerSession } from "next-auth"; | ||
import { authOptions } from "@/app/api/auth/[...nextauth]/route"; | ||
|
||
export default async function Page( {params}: { params: {id: string }}) { | ||
const session = await getServerSession(authOptions); | ||
const res = await fetch(process.env.BASE_API_URL + 'api/experiences/' + params.id); | ||
const experience = await res.json(); | ||
if (experience.org_id !== session?.user?.name) { | ||
return <h1>You are not authorized to edit this event.</h1> | ||
} | ||
return <EditEvent experience={experience} /> | ||
} |
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
f732a98
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirajismail is attempting to deploy a commit to a Personal Account on Vercel that is not owned by them.
In order for the commit to be deployed, @mirajismail must be granted access to the connected Vercel project.
If you're the owner of the Personal Account, transfer the project to a Vercel Team and start collaborating, or learn more.