Add group suggestions feature with API endpoints and frontend integration
Implemented new API endpoints for suggesting groups based on the current library, allowing admins to retrieve and create groups from suggestions. Updated the backend to include error handling for suggestions and added necessary DTOs. Enhanced the frontend with new API functions and UI components to display suggestions, improving the user experience for group management. Localization updates were made to support new features in both English and Russian.
This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
GroupDto,
|
||||
GroupElementKind,
|
||||
GroupFilter,
|
||||
GroupSuggestionDto,
|
||||
GroupSummaryDto,
|
||||
} from '@/shared/api/types'
|
||||
|
||||
@@ -39,6 +40,19 @@ export function findGroupCandidates(id: string, filter: GroupFilter | null) {
|
||||
})
|
||||
}
|
||||
|
||||
/** Что имеет смысл завести группой при нынешней библиотеке. */
|
||||
export function suggestGroups() {
|
||||
return apiRequest<GroupSuggestionDto[]>('/admin/groups/suggestions')
|
||||
}
|
||||
|
||||
/** Создаёт группу по предложению: имя, правило и состав сервер берёт по ключу сам. */
|
||||
export function createGroupFromSuggestion(key: string) {
|
||||
return apiRequest<CreatedIdResponse>('/admin/groups/suggestions', {
|
||||
method: 'POST',
|
||||
body: { key },
|
||||
})
|
||||
}
|
||||
|
||||
export function addGroupElements(
|
||||
id: string,
|
||||
elements: { elementKind: GroupElementKind; elementId: string }[],
|
||||
|
||||
Reference in New Issue
Block a user