review (solid version) (pun intented)

This commit is contained in:
amy 2024-08-04 09:46:51 +03:30
parent 56fa987021
commit 4adf257cbf
7 changed files with 153 additions and 5 deletions

View file

@ -43,8 +43,8 @@ export default function Reviews() {
return (
<>
<a style={{
display: ishover() ? "inline" : "none"
}} href="https://discord.com/oauth2/authorize?client_id=1208380910525743134&response_type=token&redirect_uri=https%3A%2F%2Freview.exhq.dev%2F&scope=identify">
display: ishover() ? "inline" : "none"
}} href="https://discord.com/oauth2/authorize?client_id=1208380910525743134&response_type=token&redirect_uri=https%3A%2F%2Fexhq.dev%2Freview%2F&scope=identify">
<p>add your reviews here</p>
</a>
<h1 class="reviewheadertext">Reviews</h1>
@ -74,4 +74,23 @@ function SingleReview(props: NeoReview) {
<div class="reviewtext"> {props.reviewText}</div>
</div>
</div>
}
}
export async function sendReview(review: string, token: string): Promise<boolean> {
try {
const response = await fetch(`https://api.review.exhq.dev/sendreview?review=${review}`, {
headers: {
"Auth": token,
},
method: "POST"
});
if (response.status !== 200) {
return false;
}
return true;
} catch (error) {
return false;
}
}