feat: Backend API für training_types + Frontend api.js
Backend (catalogs.py):
- GET /api/training-types (Liste)
- POST /api/training-types (Erstellen)
- PUT /api/training-types/{id} (Bearbeiten)
- DELETE /api/training-types/{id} (Löschen mit CASCADE-Check)
- Cascade-Protection: Fehler wenn Übungen zugeordnet
Frontend (api.js):
- listTrainingTypes(filters)
- createTrainingType(data)
- updateTrainingType(id, data)
- deleteTrainingType(id)
- Export zum api-Objekt hinzugefügt
Pattern: Konsistent mit anderen Katalog-Endpoints
CRUD: Volle Admin-Verwaltung
Version: 0.4.0
This commit is contained in:
1 parent
62b5b4c2fd
commit
72c927e69e
3 files changed
+154
-1
No files matched your search
@@ -305,6 +305,30 @@ export async function deleteTrainingCharacter(id) {
|
||||
return request(`/api/training-characters/${id}`, { method: 'DELETE' })
|
||||
}
|
||||
|
||||
// Training Types (Breitensport, Leistungssport, etc.)
|
||||
export async function listTrainingTypes(filters = {}) {
|
||||
const query = new URLSearchParams(filters).toString()
|
||||
return request(`/api/training-types${query ? '?' + query : ''}`)
|
||||
}
|
||||
|
||||
export async function createTrainingType(data) {
|
||||
return request('/api/training-types', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
}
|
||||
|
||||
export async function updateTrainingType(id, data) {
|
||||
return request(`/api/training-types/${id}`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
}
|
||||
|
||||
export async function deleteTrainingType(id) {
|
||||
return request(`/api/training-types/${id}`, { method: 'DELETE' })
|
||||
}
|
||||
|
||||
// Skill Categories
|
||||
export async function listSkillCategories(filters = {}) {
|
||||
const query = new URLSearchParams(filters).toString()
|
||||
@@ -512,6 +536,10 @@ export const api = {
|
||||
createTrainingCharacter,
|
||||
updateTrainingCharacter,
|
||||
deleteTrainingCharacter,
|
||||
listTrainingTypes,
|
||||
createTrainingType,
|
||||
updateTrainingType,
|
||||
deleteTrainingType,
|
||||
listSkillCategories,
|
||||
createSkillCategory,
|
||||
updateSkillCategory,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Shinkan Jinkendo Frontend Version
|
||||
|
||||
export const APP_VERSION = "0.3.4"
|
||||
export const APP_VERSION = "0.4.0"
|
||||
export const BUILD_DATE = "2026-04-23"
|
||||
|
||||
export const PAGE_VERSIONS = {
|
||||
|
||||
Reference in new issue
Block a user