feat: Enhance FAQ import functionality and UI improvements
- Added support for tracking the status of FAQ import tasks, including progress indicators for ongoing imports. - Introduced new localization strings for processing tasks and batch operations in multiple languages. - Updated the FAQ entry manager to display import progress and improved user feedback during the import process. - Enhanced the KnowledgeBase component to reflect the processing state of knowledge items, improving user experience during document uploads. - Implemented batch deletion functionality for chunks, streamlining the management of knowledge base content.
This commit is contained in:
@@ -81,15 +81,11 @@ func (s *tenantService) CreateTenant(ctx context.Context, tenant *types.Tenant)
|
||||
|
||||
// GetTenantByID retrieves a tenant by their ID
|
||||
func (s *tenantService) GetTenantByID(ctx context.Context, id uint) (*types.Tenant, error) {
|
||||
logger.Info(ctx, "Start retrieving tenant")
|
||||
|
||||
if id == 0 {
|
||||
logger.Error(ctx, "Tenant ID cannot be 0")
|
||||
return nil, errors.New("tenant ID cannot be 0")
|
||||
}
|
||||
|
||||
logger.Infof(ctx, "Retrieving tenant, ID: %d", id)
|
||||
|
||||
tenant, err := s.repo.GetTenantByID(ctx, id)
|
||||
if err != nil {
|
||||
logger.ErrorWithFields(ctx, err, map[string]interface{}{
|
||||
@@ -98,14 +94,11 @@ func (s *tenantService) GetTenantByID(ctx context.Context, id uint) (*types.Tena
|
||||
return nil, err
|
||||
}
|
||||
|
||||
logger.Infof(ctx, "Tenant retrieved successfully, ID: %d, name: %s", tenant.ID, tenant.Name)
|
||||
return tenant, nil
|
||||
}
|
||||
|
||||
// ListTenants retrieves a list of all tenants
|
||||
func (s *tenantService) ListTenants(ctx context.Context) ([]*types.Tenant, error) {
|
||||
logger.Info(ctx, "Start retrieving tenant list")
|
||||
|
||||
tenants, err := s.repo.ListTenants(ctx)
|
||||
if err != nil {
|
||||
logger.ErrorWithFields(ctx, err, nil)
|
||||
@@ -192,8 +185,6 @@ func (s *tenantService) UpdateAPIKey(ctx context.Context, id uint) (string, erro
|
||||
return "", errors.New("tenant ID cannot be 0")
|
||||
}
|
||||
|
||||
logger.Infof(ctx, "Retrieving tenant information, ID: %d", id)
|
||||
|
||||
tenant, err := s.repo.GetTenantByID(ctx, id)
|
||||
if err != nil {
|
||||
logger.ErrorWithFields(ctx, err, map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user