feat: category and channel endpoints

This commit is contained in:
PrimarchPaul
2025-09-27 20:45:36 -04:00
parent 9b46852e20
commit d1273ca4ec
10 changed files with 1156 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
import{
createChannel,
getChannel,
getChannelsByCategory,
updateChannel,
deleteChannel,
deleteAllChannelsFromCategory
} from "../services/channelService";
import {
CreateChannelInput,
UpdateChannelInput,
DeleteChannelInput,
DeleteChannelsByCategoryIdInput
} from "../validators/channelValidator";
export async function createNewChannel(data: CreateChannelInput) {
return await createChannel(data);
}
export async function fetchChannelData(id: string) {
return await getChannel(id);
}
export async function fetchChannelsByCategory(categoryId: string) {
return await getChannelsByCategory(categoryId);
}
export async function updateExistingChannel(data: UpdateChannelInput) {
return await updateChannel(data);
}
export async function deleteExistingChannel(data: DeleteChannelInput) {
return await deleteChannel(data);
}
export async function deleteAllChannelsByCategory(data: DeleteChannelsByCategoryIdInput) {
return await deleteAllChannelsFromCategory(data);
}