20 lines
719 B
TypeScript
20 lines
719 B
TypeScript
'use server';
|
|
import { getProfile } from './profile';
|
|
import * as api from '@repo/graphql/api/service';
|
|
// eslint-disable-next-line sonarjs/no-internal-api-use
|
|
import type * as ApolloTypes from '@repo/graphql/node_modules/@apollo/client/core';
|
|
import { type GetServicesQueryVariables } from '@repo/graphql/types';
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
type FixTypescriptCringe = ApolloTypes.FetchResult;
|
|
|
|
export async function getServices(input?: GetServicesQueryVariables) {
|
|
const customer = await getProfile();
|
|
|
|
const filters = input || { filters: { master: { documentId: { eq: customer.documentId } } } };
|
|
|
|
return api.getServices(filters);
|
|
}
|
|
|
|
export const getService = api.getService;
|