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.EventRegistration{},
|
||||
&models.PersonalBest{},
|
||||
&models.TrainingPlan{},
|
||||
// Добавьте другие модели здесь
|
||||
}
|
||||
|
||||
@@ -93,6 +94,8 @@ func getModelName(model interface{}) string {
|
||||
return "Администрирование события"
|
||||
case *models.PersonalBest:
|
||||
return "Персональные достижения"
|
||||
case *models.TrainingPlan:
|
||||
return "Тренировочный план"
|
||||
default:
|
||||
return "Unknown"
|
||||
}
|
||||
|
||||
@@ -224,7 +224,8 @@ export const useUserStore = defineStore('user', () => {
|
||||
const fetchCurrentTrainingPlan = async () => {
|
||||
return withStoreLoading(async () => {
|
||||
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
|
||||
return { success: true, data: currentTrainingPlan.value }
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user