* add basic profile page * apps/web: detect telegram/browser support browser (dev only) * apps/web: add dark mode * apps/web: support dark theme in tma * apps/web: add loading spinner remove dev info from page * apps\web\app\(auth)\page.tsx: remove useState * app/web: handle update profile name * move debounce functional to hook * add role checkbox
31 lines
769 B
TypeScript
31 lines
769 B
TypeScript
'use server';
|
|
import { getClientWithToken } from '../apollo/client';
|
|
import * as GQL from '../types';
|
|
|
|
export async function createCustomer(variables: GQL.CreateCustomerMutationVariables) {
|
|
const { mutate } = await getClientWithToken();
|
|
|
|
return mutate({
|
|
mutation: GQL.CreateCustomerDocument,
|
|
variables,
|
|
});
|
|
}
|
|
|
|
export async function getCustomer(variables: GQL.GetCustomerQueryVariables) {
|
|
const { query } = await getClientWithToken();
|
|
|
|
return query({
|
|
query: GQL.GetCustomerDocument,
|
|
variables,
|
|
});
|
|
}
|
|
|
|
export async function updateCustomerProfile(variables: GQL.UpdateCustomerProfileMutationVariables) {
|
|
const { mutate } = await getClientWithToken();
|
|
|
|
return mutate({
|
|
mutation: GQL.UpdateCustomerProfileDocument,
|
|
variables,
|
|
});
|
|
}
|