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:
@@ -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' });
|
||||
|
||||
Reference in New Issue
Block a user