From aea340fe97a70f132c46c326aeb8120bdb0da2f9 Mon Sep 17 00:00:00 2001 From: rhpidfyre Date: Wed, 11 Dec 2024 19:06:53 -0500 Subject: [PATCH] Submission buttons working? --- .../[submissionId]/_reviewButtons.tsx | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/web/src/app/submissions/[submissionId]/_reviewButtons.tsx b/web/src/app/submissions/[submissionId]/_reviewButtons.tsx index b30ce05..9f226f8 100644 --- a/web/src/app/submissions/[submissionId]/_reviewButtons.tsx +++ b/web/src/app/submissions/[submissionId]/_reviewButtons.tsx @@ -6,9 +6,33 @@ interface ReviewButton { color: ButtonOwnProps["color"] } +// CREATE: +// curl -H 'Content-Type: application/json' \ +// --cookie "session_id=123" \ +// -d '{"ID":0,"DisplayName":"Example Map","Creator":"Quaternions","GameID":1,"Date":"2024-12-09T20:43:49.957660142-08:00","Submitter":52250025,"AssetID":255299419,"AssetVersion":7,"Completed":true,"TargetAssetID":5692134283,"StatusID":0}' \ +// -X POST \ +// localhost:8081/v1/submissions + +// GET: +// curl -H 'Content-Type: application/json' \ +// --cookie "session_id=c5191ddc-eee1-4010-900c-6b2c7b6780ab" \ +// -X GET \ +// localhost:8081/v1/submissions/1 + +// SUBMIT: +// curl -H 'Content-Type: application/json' \ +// --cookie "session_id=c5191ddc-eee1-4010-900c-6b2c7b6780ab" \ +// -X POST \ +// localhost:8081/v1/submissions/1/status/submit + function ReviewButtonClicked(type: Review) { - //magical api requesting goes here, i hope it wont blow up - console.log(type) + const post = fetch(`http://localhost:8081/v1/submissions/1/status/${type.toLowerCase()}`, { + method: "POST", + headers: { + "Content-type": "application/json", + "Cookie": "session_id=c5191ddc-eee1-4010-900c-6b2c7b6780ab" + } + }) } function ReviewButton(props: ReviewButton) {