modified: serv_nginx/api_bb/internal/database/migrate.go
modified: serv_nginx/bbvue/src/stores/user.js add migration for trainingPlan struct
This commit is contained in:
@@ -25,6 +25,7 @@ func (d *Database) Migrate() error {
|
|||||||
&models.Event{},
|
&models.Event{},
|
||||||
&models.EventRegistration{},
|
&models.EventRegistration{},
|
||||||
&models.PersonalBest{},
|
&models.PersonalBest{},
|
||||||
|
&models.TrainingPlan{},
|
||||||
// Добавьте другие модели здесь
|
// Добавьте другие модели здесь
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,6 +94,8 @@ func getModelName(model interface{}) string {
|
|||||||
return "Администрирование события"
|
return "Администрирование события"
|
||||||
case *models.PersonalBest:
|
case *models.PersonalBest:
|
||||||
return "Персональные достижения"
|
return "Персональные достижения"
|
||||||
|
case *models.TrainingPlan:
|
||||||
|
return "Тренировочный план"
|
||||||
default:
|
default:
|
||||||
return "Unknown"
|
return "Unknown"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,7 +224,8 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
const fetchCurrentTrainingPlan = async () => {
|
const fetchCurrentTrainingPlan = async () => {
|
||||||
return withStoreLoading(async () => {
|
return withStoreLoading(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await apiClient.get('/training-plans/current')
|
const response = await apiClient.get('/user/training-plans/active')
|
||||||
|
console.log("debug /user/training-plans/active " + response.data)
|
||||||
currentTrainingPlan.value = response.data
|
currentTrainingPlan.value = response.data
|
||||||
return { success: true, data: currentTrainingPlan.value }
|
return { success: true, data: currentTrainingPlan.value }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user