feat: reporting apis; better rate limiting

refactor: change certain apis to be more REST like (e.g. DELETE /api/paste/{pasteId}/delete -> DELETE /api/paste/{pasteId}
This commit is contained in:
2026-01-10 00:06:36 -05:00
parent 864a4ee91a
commit 14bbd9c762
15 changed files with 954 additions and 48 deletions
@@ -171,7 +171,7 @@
const encrypted = await encryptAES(content, password);
content = encrypted;
}
const res = await fetch(`/api/paste/${data.paste.id}/edit`, {
const res = await fetch(`/api/paste/${data.paste.id}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
@@ -196,7 +196,7 @@
metadata?.title !== data.paste.title) &&
metadata !== null
) {
const res = await fetch(`/api/paste/${data.paste.id}/modify`, {
const res = await fetch(`/api/paste/${data.paste.id}`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
@@ -582,7 +582,7 @@
if (!token) {
return;
}
const res = await fetch(`/api/paste/${data.paste?.id}/delete`, {
const res = await fetch(`/api/paste/${data.paste?.id}`, {
method: 'DELETE',
headers: {
Authorization: `Bearer ${token}`