feat: Заметки редактора в admin zeropost.ru

- app/admin/(protected)/notes/page.js: управление заметками
- app/admin/api/notes/route.js: GET+POST прокси к engine
- app/admin/api/notes/[id]/route.js: PATCH+DELETE
- lib/engine.js: createNote, updateNote, deleteNote
- components/admin/AdminNav.js: пункт «Заметки» с иконкой
This commit is contained in:
Ник (Claude)
2026-06-09 11:55:55 +03:00
parent 334b2f51df
commit 290fc160cc
5 changed files with 197 additions and 1 deletions
+10
View File
@@ -68,6 +68,16 @@ export async function listNotes({ limit = 20 } = {}) {
catch { return []; }
}
export async function createNote(data) {
return call('/api/notes', { method: 'POST', body: JSON.stringify(data) });
}
export async function updateNote(id, data) {
return call(`/api/notes/${id}`, { method: 'PATCH', body: JSON.stringify(data) });
}
export async function deleteNote(id) {
return call(`/api/notes/${id}`, { method: 'DELETE' });
}
export async function getStats() {
try {
return await call('/api/stats', { cache: 'no-store' });