feat: remove info entity (admin CRUD layer)

This commit is contained in:
Kirill
2026-05-19 14:55:28 +05:00
parent dbe36ce6fd
commit 5eadbd0d0e
3 changed files with 0 additions and 49 deletions
@@ -1,31 +0,0 @@
import { apiClient } from '@/shared/api/client'
import type { InfoPageBlock } from '../model/types'
export async function fetchPublicInfoBlocks(): Promise<{ items: InfoPageBlock[] }> {
const { data } = await apiClient.get<{ items: InfoPageBlock[] }>('info-page/blocks')
return data
}
export async function fetchAdminInfoBlocks(): Promise<{ items: InfoPageBlock[] }> {
const { data } = await apiClient.get<{ items: InfoPageBlock[] }>('admin/info-page/blocks')
return data
}
export async function createInfoBlock(
body: Pick<InfoPageBlock, 'key' | 'title' | 'body' | 'sort' | 'published'>,
): Promise<{ item: InfoPageBlock }> {
const { data } = await apiClient.post<{ item: InfoPageBlock }>('admin/info-page/blocks', body)
return data
}
export async function updateInfoBlock(
id: string,
body: Partial<Pick<InfoPageBlock, 'key' | 'title' | 'body' | 'sort' | 'published'>>,
): Promise<{ item: InfoPageBlock }> {
const { data } = await apiClient.patch<{ item: InfoPageBlock }>(`admin/info-page/blocks/${id}`, body)
return data
}
export async function deleteInfoBlock(id: string): Promise<void> {
await apiClient.delete(`admin/info-page/blocks/${id}`)
}
-8
View File
@@ -1,8 +0,0 @@
export {
fetchPublicInfoBlocks,
fetchAdminInfoBlocks,
createInfoBlock,
updateInfoBlock,
deleteInfoBlock,
} from './api/info-page-api'
export type { InfoPageBlock } from './model/types'
-10
View File
@@ -1,10 +0,0 @@
export type InfoPageBlock = {
id: string
key: string
title: string
body: string
sort: number
published: boolean
createdAt: string
updatedAt: string
}