code made pretty
This commit is contained in:
@@ -1,39 +1,40 @@
|
||||
import{
|
||||
createCategory,
|
||||
getCategory,
|
||||
getCategoriesByInstance,
|
||||
updateCategory,
|
||||
deleteCategory,
|
||||
deleteAllCategoriesFromInstance,
|
||||
import {
|
||||
createCategory,
|
||||
getCategory,
|
||||
getCategoriesByInstance,
|
||||
updateCategory,
|
||||
deleteCategory,
|
||||
deleteAllCategoriesFromInstance,
|
||||
} from "../services/channelService";
|
||||
import{
|
||||
CreateCategoryInput,
|
||||
UpdateCategoryInput,
|
||||
DeleteCategoryInput,
|
||||
DeleteCategoriesByInstanceIdInput
|
||||
import {
|
||||
CreateCategoryInput,
|
||||
UpdateCategoryInput,
|
||||
DeleteCategoryInput,
|
||||
DeleteCategoriesByInstanceIdInput,
|
||||
} from "../validators/categoryValidator";
|
||||
|
||||
export async function createNewCategory(data: CreateCategoryInput) {
|
||||
return await createCategory(data);
|
||||
return await createCategory(data);
|
||||
}
|
||||
|
||||
export async function fetchCategoryData(id: string) {
|
||||
return await getCategory(id);
|
||||
return await getCategory(id);
|
||||
}
|
||||
|
||||
export async function fetchCategoriesByInstance(instanceId: string) {
|
||||
return await getCategoriesByInstance(instanceId);
|
||||
return await getCategoriesByInstance(instanceId);
|
||||
}
|
||||
|
||||
export async function updateExistingCategory(data: UpdateCategoryInput) {
|
||||
return await updateCategory(data);
|
||||
return await updateCategory(data);
|
||||
}
|
||||
|
||||
export async function deleteExistingCategory(data: DeleteCategoryInput) {
|
||||
return await deleteCategory(data);
|
||||
return await deleteCategory(data);
|
||||
}
|
||||
|
||||
export async function deleteAllCategoriesByInstance(data: DeleteCategoriesByInstanceIdInput) {
|
||||
return await deleteAllCategoriesFromInstance(data);
|
||||
export async function deleteAllCategoriesByInstance(
|
||||
data: DeleteCategoriesByInstanceIdInput,
|
||||
) {
|
||||
return await deleteAllCategoriesFromInstance(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,38 +1,40 @@
|
||||
import{
|
||||
createChannel,
|
||||
getChannel,
|
||||
getChannelsByCategory,
|
||||
updateChannel,
|
||||
deleteChannel,
|
||||
deleteAllChannelsFromCategory
|
||||
import {
|
||||
createChannel,
|
||||
getChannel,
|
||||
getChannelsByCategory,
|
||||
updateChannel,
|
||||
deleteChannel,
|
||||
deleteAllChannelsFromCategory,
|
||||
} from "../services/channelService";
|
||||
import {
|
||||
CreateChannelInput,
|
||||
UpdateChannelInput,
|
||||
DeleteChannelInput,
|
||||
DeleteChannelsByCategoryIdInput
|
||||
CreateChannelInput,
|
||||
UpdateChannelInput,
|
||||
DeleteChannelInput,
|
||||
DeleteChannelsByCategoryIdInput,
|
||||
} from "../validators/channelValidator";
|
||||
|
||||
export async function createNewChannel(data: CreateChannelInput) {
|
||||
return await createChannel(data);
|
||||
return await createChannel(data);
|
||||
}
|
||||
|
||||
export async function fetchChannelData(id: string) {
|
||||
return await getChannel(id);
|
||||
return await getChannel(id);
|
||||
}
|
||||
|
||||
export async function fetchChannelsByCategory(categoryId: string) {
|
||||
return await getChannelsByCategory(categoryId);
|
||||
return await getChannelsByCategory(categoryId);
|
||||
}
|
||||
|
||||
export async function updateExistingChannel(data: UpdateChannelInput) {
|
||||
return await updateChannel(data);
|
||||
return await updateChannel(data);
|
||||
}
|
||||
|
||||
export async function deleteExistingChannel(data: DeleteChannelInput) {
|
||||
return await deleteChannel(data);
|
||||
return await deleteChannel(data);
|
||||
}
|
||||
|
||||
export async function deleteAllChannelsByCategory(data: DeleteChannelsByCategoryIdInput) {
|
||||
return await deleteAllChannelsFromCategory(data);
|
||||
}
|
||||
export async function deleteAllChannelsByCategory(
|
||||
data: DeleteChannelsByCategoryIdInput,
|
||||
) {
|
||||
return await deleteAllChannelsFromCategory(data);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { createInstance, getAllInstances } from "../services/instanceService";
|
||||
import { CreateInstanceRequest } from "../validators/instanceValidator";
|
||||
|
||||
export async function createInstanceReq(data:CreateInstanceRequest) {
|
||||
return await createInstance(data);
|
||||
export async function createInstanceReq(data: CreateInstanceRequest) {
|
||||
return await createInstance(data);
|
||||
}
|
||||
|
||||
export async function getAllInstancesReq() {
|
||||
return await getAllInstances();
|
||||
}
|
||||
return await getAllInstances();
|
||||
}
|
||||
|
||||
@@ -1,25 +1,29 @@
|
||||
import { getMessageInformation, getMessagesBefore, sendMessageToChannel } from "../services/messageService";
|
||||
import {
|
||||
getMessageInformation,
|
||||
getMessagesBefore,
|
||||
sendMessageToChannel,
|
||||
} from "../services/messageService";
|
||||
|
||||
export async function fetchMessageData(id:string) {
|
||||
return await getMessageInformation(id);
|
||||
export async function fetchMessageData(id: string) {
|
||||
return await getMessageInformation(id);
|
||||
}
|
||||
|
||||
export async function fetchMessagesBefore(date:string, channelId:string) {
|
||||
return getMessagesBefore(date, channelId);
|
||||
export async function fetchMessagesBefore(date: string, channelId: string) {
|
||||
return getMessagesBefore(date, channelId);
|
||||
}
|
||||
|
||||
export async function sendMessage(
|
||||
channelId: string,
|
||||
userId: string,
|
||||
content: string,
|
||||
token: string,
|
||||
repliedMessageId: string | null
|
||||
channelId: string,
|
||||
userId: string,
|
||||
content: string,
|
||||
token: string,
|
||||
repliedMessageId: string | null,
|
||||
) {
|
||||
return await sendMessageToChannel(
|
||||
channelId,
|
||||
userId,
|
||||
content,
|
||||
token,
|
||||
repliedMessageId
|
||||
);
|
||||
}
|
||||
return await sendMessageToChannel(
|
||||
channelId,
|
||||
userId,
|
||||
content,
|
||||
token,
|
||||
repliedMessageId,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user