feat: minimum working comments app
Python Lint CI / ty (push) Successful in 58s
TS Lint / ESLint (push) Successful in 58s
Python Lint CI / ruff (push) Successful in 58s
Python Lint CI / ruff-format-check (push) Successful in 58s
TS Lint / TypeScript (push) Successful in 3m28s
TS Lint / Oxlint (push) Successful in 3m28s
Python Lint CI / ty (push) Successful in 58s
TS Lint / ESLint (push) Successful in 58s
Python Lint CI / ruff (push) Successful in 58s
Python Lint CI / ruff-format-check (push) Successful in 58s
TS Lint / TypeScript (push) Successful in 3m28s
TS Lint / Oxlint (push) Successful in 3m28s
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import type { Comment } from "@/types";
|
||||
|
||||
export async function getComments(): Promise<Comment[]> {
|
||||
const response = await fetch("/api/comments");
|
||||
return await response.json();
|
||||
}
|
||||
|
||||
export async function postComment(content: string): Promise<void> {
|
||||
await fetch("/api/comments", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ content }),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user