Skip to content

Commit

Permalink
[CIT-34] Allow organizers to edit events they've created (#43)
Browse files Browse the repository at this point in the history
* finished org edit

* Trigger build

---------

Co-authored-by: Ishaan <[email protected]>
  • Loading branch information
mirajismail and ishaan-upadhyay authored Jul 21, 2023
1 parent ef8530d commit f732a98
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions citrus/app/(organizers)/organizer/dashboard/[id]/page.tsx
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} />
}
2 changes: 1 addition & 1 deletion citrus/components/EventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function deleteOnClick(eventID: string) {
}

function ManagementTools({ eventID, isUser }: { eventID: string, isUser: boolean }) {
const manageLink = (isUser) ? "/edit/" + eventID : "/organizer/dashboard" + eventID;
const manageLink = (isUser) ? "/edit/" + eventID : "/organizer/dashboard/" + eventID;
return (
<div className="flex flex-row">
<a href={manageLink}>
Expand Down

1 comment on commit f732a98

@vercel
Copy link

@vercel vercel bot commented on f732a98 Jul 21, 2023

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.

Please sign in to comment.