mirror of
https://github.com/beilunyang/moemail.git
synced 2026-09-07 08:16:37 +08:00
refactor: favicon 移回 app/ + 删除用户改为 RESTful DELETE /api/users/[id]
- favicon: 从 public/favicon.ico 移回 app/favicon.ico(next-on-pages 1.13.16 下生产验证 /favicon.ico 正常返回) - 删除用户: POST /api/roles/delete 改为 DELETE /api/users/[id],符合 RESTful 语义(资源 users + 标准 DELETE 方法)
This commit is contained in:
@@ -135,10 +135,8 @@ export function PromotePanel() {
|
||||
const handleDelete = async (user: UserItem) => {
|
||||
setDeletingUserId(user.id)
|
||||
try {
|
||||
const res = await fetch("/api/roles/delete", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ userId: user.id }),
|
||||
const res = await fetch(`/api/users/${user.id}`, {
|
||||
method: "DELETE",
|
||||
})
|
||||
if (!res.ok) {
|
||||
const error = await res.json() as { error: string }
|
||||
|
||||
Reference in New Issue
Block a user