Lerning points where not fetched with correct params
This commit is contained in:
@@ -44,6 +44,18 @@ func TestGetCharacterClassLearningPoints(t *testing.T) {
|
|||||||
checkSpells bool
|
checkSpells bool
|
||||||
expectedSpells int
|
expectedSpells int
|
||||||
}{
|
}{
|
||||||
|
{
|
||||||
|
name: "Valid Spitzbube class Mittelschicht stand",
|
||||||
|
classParam: "Spitzbube",
|
||||||
|
standParam: "Mittelschicht",
|
||||||
|
expectedStatus: http.StatusOK,
|
||||||
|
expectError: false,
|
||||||
|
expectedClass: "Spitzbube",
|
||||||
|
checkWeapons: true,
|
||||||
|
expectedWeapons: 20,
|
||||||
|
checkSpells: true,
|
||||||
|
expectedSpells: 0,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Valid Hexer class without stand",
|
name: "Valid Hexer class without stand",
|
||||||
classParam: "Hexer",
|
classParam: "Hexer",
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ export default {
|
|||||||
await this.loadSkillCategories()
|
await this.loadSkillCategories()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadSession() {
|
async loadSession(preserveCurrentStep = false) {
|
||||||
try {
|
try {
|
||||||
const token = localStorage.getItem('token')
|
const token = localStorage.getItem('token')
|
||||||
const response = await API.get(`/api/characters/create-session/${this.sessionId}`, {
|
const response = await API.get(`/api/characters/create-session/${this.sessionId}`, {
|
||||||
@@ -142,7 +142,10 @@ export default {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.sessionData = response.data
|
this.sessionData = response.data
|
||||||
|
// Only update currentStep if not preserving it
|
||||||
|
if (!preserveCurrentStep) {
|
||||||
this.currentStep = response.data.current_step || 1
|
this.currentStep = response.data.current_step || 1
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error loading session:', error)
|
console.error('Error loading session:', error)
|
||||||
this.$router.push('/dashboard')
|
this.$router.push('/dashboard')
|
||||||
@@ -179,6 +182,10 @@ export default {
|
|||||||
// Save progress for current step before moving to next
|
// Save progress for current step before moving to next
|
||||||
await this.saveProgressForStep(this.currentStep, data)
|
await this.saveProgressForStep(this.currentStep, data)
|
||||||
|
|
||||||
|
// Reload session data from backend to ensure consistent state
|
||||||
|
// Preserve currentStep as we'll increment it after
|
||||||
|
await this.loadSession(true)
|
||||||
|
|
||||||
// Move to next step
|
// Move to next step
|
||||||
this.currentStep++
|
this.currentStep++
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user