remove extensive debug output
This commit is contained in:
@@ -183,7 +183,6 @@ export default {
|
||||
this.currentStep++
|
||||
} catch (error) {
|
||||
console.error('Failed to save progress before moving to next step:', error)
|
||||
console.error('Data that failed to save:', data)
|
||||
// Don't move to next step if save failed
|
||||
}
|
||||
},
|
||||
@@ -210,7 +209,6 @@ export default {
|
||||
glaube: basicInfo.glaube || this.sessionData.glaube || '',
|
||||
}
|
||||
// Validate that all required fields are present
|
||||
console.log('BasicInfo payload before sending:', payload)
|
||||
if (!payload.name || !payload.geschlecht || !payload.rasse || !payload.typ || !payload.herkunft || !payload.stand) {
|
||||
throw new Error(`Missing required fields: name=${payload.name}, geschlecht=${payload.geschlecht}, rasse=${payload.rasse}, typ=${payload.typ}, herkunft=${payload.herkunft}, stand=${payload.stand}`)
|
||||
}
|
||||
@@ -234,21 +232,12 @@ export default {
|
||||
}
|
||||
|
||||
if (endpoint) {
|
||||
console.log('Saving progress for step', step, 'with payload:', payload)
|
||||
console.log('Original data received:', data)
|
||||
console.log('sessionData:', this.sessionData)
|
||||
console.log('basicInfo extraction:', data.basic_info || data)
|
||||
const response = await API.put(endpoint, payload, {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
})
|
||||
console.log('Save response:', response.data)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error saving progress for step', step, ':', error)
|
||||
if (error.response) {
|
||||
console.error('Error response data:', error.response.data)
|
||||
console.error('Error response status:', error.response.status)
|
||||
}
|
||||
|
||||
// Provide more specific error messages
|
||||
if (error.response && error.response.status === 401) {
|
||||
@@ -256,9 +245,9 @@ export default {
|
||||
} else if (error.response && error.response.status === 400) {
|
||||
const errorMsg = error.response.data?.error || 'Invalid data submitted'
|
||||
alert(`Error saving character data: ${errorMsg}`)
|
||||
} else {
|
||||
alert('Failed to save character data. Please try again.')
|
||||
}
|
||||
} //else {
|
||||
//alert('Failed to save character data. Please try again.')
|
||||
//}
|
||||
throw error // Re-throw to handle in calling function
|
||||
}
|
||||
},
|
||||
@@ -306,7 +295,7 @@ export default {
|
||||
const characterId = response.data.character_id
|
||||
|
||||
// Success message
|
||||
alert('Character successfully created!')
|
||||
//alert('Character successfully created!')
|
||||
|
||||
// Navigate to character view or back to character list
|
||||
this.$router.push(`/character/${characterId}`)
|
||||
|
||||
@@ -243,7 +243,6 @@ export default {
|
||||
maxValue = 80
|
||||
raceRestriction = ` (${race} maximum: 80)`
|
||||
}
|
||||
//console.log('rollvalue, minval, maxval, race:', rollValue ,minValue, maxValue, race)
|
||||
|
||||
// Store original roll value for comparison
|
||||
const originalRollValue = rollValue
|
||||
@@ -254,7 +253,6 @@ export default {
|
||||
} else if (rollValue > maxValue) {
|
||||
rollValue = maxValue
|
||||
}
|
||||
//console.log('2 rollvalue, minval, maxval, race:', rollValue ,minValue, maxValue, race)
|
||||
roll = {
|
||||
...roll,
|
||||
selectedValue: rollValue
|
||||
@@ -269,7 +267,6 @@ export default {
|
||||
roll = this.$rollNotation('max(2d100)')
|
||||
rollValue = roll.selectedValue
|
||||
rollDescription = `max of ${roll.rolls.join(', ')}`
|
||||
//console.log('Standard max(2d100) roll for other attributes:', rollValue)
|
||||
}
|
||||
|
||||
const attributeName = this.attributes.find(attr => attr.key === attributeKey)?.name || attributeKey
|
||||
@@ -296,8 +293,6 @@ export default {
|
||||
rollAllAttributes() {
|
||||
// Roll all attributes at once
|
||||
Object.keys(this.formData).forEach(key => {
|
||||
//const roll = this.$rollNotation('max(2d100)')
|
||||
//this.formData[key] = roll.selectedValue
|
||||
this.rollAttribute(key)
|
||||
})
|
||||
this.updateTotal()
|
||||
|
||||
@@ -200,14 +200,6 @@ export default {
|
||||
handler(newValue) {
|
||||
// Only save if component is fully initialized
|
||||
if (this.isInitialized) {
|
||||
console.log('BasicInfo: formData changed, emitting save:', newValue)
|
||||
console.log('BasicInfo: Field validation status:')
|
||||
console.log(' name valid:', newValue.name && newValue.name.length >= 2)
|
||||
console.log(' geschlecht valid:', !!newValue.geschlecht)
|
||||
console.log(' rasse valid:', !!newValue.rasse)
|
||||
console.log(' typ valid:', !!newValue.typ)
|
||||
console.log(' herkunft valid:', !!newValue.herkunft)
|
||||
console.log(' stand valid:', !!newValue.stand)
|
||||
this.$emit('save', { basic_info: newValue })
|
||||
}
|
||||
},
|
||||
@@ -215,10 +207,8 @@ export default {
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
console.log('BasicInfo: created() called, sessionData:', this.sessionData)
|
||||
// Initialize form with session data - check both old format and new basic_info format
|
||||
const basicInfo = this.sessionData.basic_info || {}
|
||||
console.log('BasicInfo: extracted basicInfo:', basicInfo)
|
||||
this.formData = {
|
||||
name: basicInfo.name || this.sessionData.name || '',
|
||||
geschlecht: basicInfo.geschlecht || this.sessionData.geschlecht || '',
|
||||
@@ -228,14 +218,12 @@ export default {
|
||||
stand: basicInfo.stand || this.sessionData.stand || '',
|
||||
glaube: basicInfo.glaube || this.sessionData.glaube || '',
|
||||
}
|
||||
console.log('BasicInfo: initialized formData:', this.formData)
|
||||
|
||||
if (this.formData.glaube) {
|
||||
this.beliefSearch = this.formData.glaube
|
||||
}
|
||||
|
||||
// Save initial state to ensure all fields are captured
|
||||
console.log('BasicInfo: Initial save, formData:', this.formData)
|
||||
this.$emit('save', { basic_info: this.formData })
|
||||
|
||||
await this.loadReferenceData()
|
||||
@@ -392,24 +380,10 @@ export default {
|
||||
},
|
||||
|
||||
handleSubmit() {
|
||||
console.log('BasicInfo: handleSubmit called')
|
||||
console.log('BasicInfo: isValid =', this.isValid)
|
||||
console.log('BasicInfo: formData validation:')
|
||||
console.log(' name:', this.formData.name, '(length:', this.formData.name.length, ')')
|
||||
console.log(' geschlecht:', this.formData.geschlecht)
|
||||
console.log(' rasse:', this.formData.rasse)
|
||||
console.log(' typ:', this.formData.typ)
|
||||
console.log(' herkunft:', this.formData.herkunft)
|
||||
console.log(' stand:', this.formData.stand)
|
||||
console.log(' glaube:', this.formData.glaube)
|
||||
|
||||
if (this.isValid) {
|
||||
console.log('BasicInfo: handleSubmit, formData:', this.formData)
|
||||
// Save the current state before proceeding
|
||||
this.$emit('save', { basic_info: this.formData })
|
||||
this.$emit('next', { basic_info: this.formData })
|
||||
} else {
|
||||
console.warn('BasicInfo: Form is not valid, submission blocked')
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user