-
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.
* Trigger build * CIT-23: add Uninterest button * CIT-23: switch to status api route * CIT-23: add Uninterest button * Trigger build --------- Co-authored-by: Ishaan <[email protected]>
- Loading branch information
1 parent
f732a98
commit 485e64d
Showing
6 changed files
with
101 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,5 @@ citrus/next-env.d.ts | |
.vercel | ||
|
||
#data | ||
cockroach-data/ | ||
cockroach-data/ | ||
node_modules/ |
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,37 @@ | ||
"use client"; | ||
import { useRouter } from "next/navigation"; | ||
|
||
async function onUninterestHandler(username: string | null | undefined, eventID: string){ | ||
const res = await fetch(`/api/experiences/${eventID}`); | ||
console.log(res); | ||
const data = await res.json(); | ||
const attendees = data.attendees; | ||
const index = attendees.indexOf(username); | ||
if (index > -1) { | ||
attendees.splice(index, 1); | ||
const res2 = await fetch(`/api/experiences/${eventID}?addUser=false`, { | ||
method: 'PUT', | ||
body: JSON.stringify({"attendees": attendees}), | ||
}); | ||
console.log(res2); | ||
} | ||
|
||
const res3 = await fetch(`/api/statuses?event_id=${eventID}`, { | ||
method: 'DELETE' | ||
}); | ||
console.log(res3); | ||
|
||
} | ||
|
||
export default function UninterestButton({username, eventID}: {username: string | null | undefined, eventID: string}){ | ||
const router = useRouter(); | ||
return ( | ||
<div className="m-20 flex items-center justify-center"> | ||
<button className="text-center text-white font-semibold z-10 i h-16 w-64 bg-gradient-to-br from-yellow-400 to-yellow-600 items-center | ||
rounded-full shadow-2xl cursor-pointer absolute overflow-hidden transform hover:scale-x-110 | ||
hover:scale-y-105 transition duration-300 ease-out" | ||
onClick={async () => {await onUninterestHandler(username, eventID); router.refresh()}}>I'm no longer interested</button> | ||
</div> | ||
) | ||
|
||
} |
485e64d
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.
@TheDannyG 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, @TheDannyG 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.