fix: Resolve Quick Start Wizard error display and policy creation issues

- Fixed error response format to send error message as string instead of boolean
- Enhanced error handling in QuickStartWizard to use handleApiError helper
- Improved policy creation with temp directory verification
- Added specific error detection for policy operations
- Fixed error display showing "true" instead of actual error message
- Ensured temp directory exists before writing policy files
- Added file access verification before executing MinIO commands
- Better cleanup of temporary files on failure

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-08-19 21:40:45 +02:00
parent 93d9c47ad5
commit df78c57c48
3 changed files with 29 additions and 5 deletions
@@ -41,7 +41,7 @@ import {
import { useTranslation } from 'react-i18next';
import userService from '../../services/userService';
import policyService from '../../services/policyService';
import api from '../../services/api';
import api, { handleApiError } from '../../services/api';
interface QuickStartWizardProps {
open: boolean;
@@ -219,8 +219,9 @@ const QuickStartWizard: React.FC<QuickStartWizardProps> = ({
setCompletedSetup(results);
setActiveStep(steps.length);
} catch (err) {
setError(err instanceof Error ? err.message : t('quickWizard:errors.creationFailed'));
} catch (err: any) {
const errorMessage = handleApiError(err);
setError(errorMessage);
setIsCreating(false);
} finally {
setLoading(false);
@@ -297,7 +298,7 @@ const QuickStartWizard: React.FC<QuickStartWizardProps> = ({
value={setupData.userPassword}
onChange={(e) => setSetupData({ ...setupData, userPassword: e.target.value })}
error={!!error && activeStep === 1}
helperText={error || t('quickWizard:user.passwordHelper')}
helperText={(error && activeStep === 1 ? error : '') || t('quickWizard:user.passwordHelper')}
InputProps={{
endAdornment: (
<InputAdornment position="end">