feat: enhance API route naming conventions and structure
- Added comprehensive guidelines for API route naming and structure in `ROUTE_NAMING_BEST_PRACTICES.md`. - Updated `ARCHITECHTURE.md` to reference the new best practices document. - Refactored course-related routes to follow new naming conventions, including changes to endpoint paths and validation schemas. - Removed the deprecated course clone route and integrated cloning functionality directly into the course routes. - Adjusted various API methods to ensure consistent usage of HTTP methods and parameter structures across the application.
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import * as z from 'zod';
|
||||
|
||||
import { ALLOWED_CONTENT_TYPES, ALLOWED_DOCUMENT_TYPES } from '../constants';
|
||||
|
||||
import { z } from 'zod';
|
||||
|
||||
export const ZCourseClone = z.object({
|
||||
id: z.string().min(1),
|
||||
title: z.string().min(1),
|
||||
description: z.string().optional(),
|
||||
slug: z.string().min(1),
|
||||
@@ -11,6 +10,16 @@ export const ZCourseClone = z.object({
|
||||
});
|
||||
export type TCourseClone = z.infer<typeof ZCourseClone>;
|
||||
|
||||
export const ZCourseCloneParam = z.object({
|
||||
courseId: z.string().min(1)
|
||||
});
|
||||
export type TCourseCloneParam = z.infer<typeof ZCourseCloneParam>;
|
||||
|
||||
export const ZCourseDownloadParam = z.object({
|
||||
courseId: z.string().min(1)
|
||||
});
|
||||
export type TCourseDownloadParam = z.infer<typeof ZCourseDownloadParam>;
|
||||
|
||||
export const ZCertificateDownload = z.object({
|
||||
theme: z.string().min(1),
|
||||
studentName: z.string().min(1),
|
||||
|
||||
Reference in New Issue
Block a user