* chore(docker): add healthcheck to service in docker-compose.yml and update deploy workflow to include docker compose down * refactor(orders): add useOrdersInfiniteQuery for improved pagination and add load more button in orders list components * refactor(graphql): remove NotifyService and related notification logic from orders and API, clean up unused dependencies * refactor(api): streamline customer, order, service, and slot actions by wrapping server functions with client action utility to rethrow error messages to client
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
'use server';
|
|
|
|
import { useService } from '../lib/service';
|
|
import { wrapServerAction } from '@/utils/actions';
|
|
import { CustomersService } from '@repo/graphql/api/customers';
|
|
|
|
const getService = useService(CustomersService);
|
|
|
|
export async function addMasters(...variables: Parameters<CustomersService['addMasters']>) {
|
|
const service = await getService();
|
|
|
|
return wrapServerAction(() => service.addMasters(...variables));
|
|
}
|
|
|
|
export async function getClients(...variables: Parameters<CustomersService['getClients']>) {
|
|
const service = await getService();
|
|
|
|
return wrapServerAction(() => service.getClients(...variables));
|
|
}
|
|
|
|
export async function getCustomer(...variables: Parameters<CustomersService['getCustomer']>) {
|
|
const service = await getService();
|
|
|
|
return wrapServerAction(() => service.getCustomer(...variables));
|
|
}
|
|
|
|
export async function getMasters(...variables: Parameters<CustomersService['getMasters']>) {
|
|
const service = await getService();
|
|
|
|
return wrapServerAction(() => service.getMasters(...variables));
|
|
}
|
|
|
|
export async function updateCustomer(...variables: Parameters<CustomersService['updateCustomer']>) {
|
|
const service = await getService();
|
|
|
|
return wrapServerAction(() => service.updateCustomer(...variables));
|
|
}
|