fix: allow editing empty draft trails
This commit is contained in:
@@ -74,6 +74,13 @@ export interface LearningPathInput {
|
||||
status: 'draft' | 'published';
|
||||
courseIds: string[];
|
||||
}
|
||||
export interface TrailCourseOption {
|
||||
id: string;
|
||||
title: string;
|
||||
status: 'draft' | 'published';
|
||||
category: string;
|
||||
coverImageUrl: string | null;
|
||||
}
|
||||
export interface HomeBannerInput {
|
||||
kind: 'course' | 'custom';
|
||||
courseId: string | null;
|
||||
@@ -197,6 +204,7 @@ export const adminApi = {
|
||||
async createCategory(name: string) { return apiRequest<{ data: { id: string; name: string; position: number; isActive: boolean } }>('/admin/categories', { method: 'POST', body: JSON.stringify({ name }) }); },
|
||||
async updateCategory(categoryId: string, update: { name: string; isActive?: boolean; position?: number }) { return apiRequest<{ data: { id: string; name: string; position: number; isActive: boolean } }>(`/admin/categories/${categoryId}`, { method: 'PATCH', body: JSON.stringify(update) }); },
|
||||
async listPaths() { return apiRequest<{ data: LearningPath[] }>('/admin/paths'); },
|
||||
async listPathCourses() { return apiRequest<{ data: TrailCourseOption[] }>('/admin/path-courses'); },
|
||||
async createPath(input: LearningPathInput) { return apiRequest<{ data: LearningPath }>('/admin/paths', { method: 'POST', body: JSON.stringify(input) }); },
|
||||
async updatePath(pathId: string, input: LearningPathInput) { return apiRequest<{ data: LearningPath }>(`/admin/paths/${pathId}`, { method: 'PATCH', body: JSON.stringify(input) }); },
|
||||
async deletePath(pathId: string) { return apiRequest<void>(`/admin/paths/${pathId}`, { method: 'DELETE' }); },
|
||||
|
||||
Reference in New Issue
Block a user