* refactor: remove mappers * chore: generate graphql types * lint: remove useless import * Remove preset-react-create-app from storybook addons * test: remove old tests * Upgrade storybook version * Remove sb preset-cra and add sb svgr loader * chore: remove figma image url from storybook --------- Co-authored-by: Charles Bochet <charles@twenty.com>
22 lines
613 B
TypeScript
22 lines
613 B
TypeScript
import { Workspace as GQLWorkspace } from '../../../generated/graphql';
|
|
import { DeepPartial } from '../../utils/utils';
|
|
|
|
export type Workspace = DeepPartial<GQLWorkspace> & { id: GQLWorkspace['id'] };
|
|
|
|
export type GraphqlQueryWorkspace = Workspace;
|
|
|
|
export type GraphqlMutationWorkspace = Workspace;
|
|
|
|
export const mapToWorkspace = (
|
|
workspace: GraphqlQueryWorkspace,
|
|
): Workspace => ({
|
|
id: workspace.id,
|
|
domainName: workspace.domainName,
|
|
displayName: workspace.displayName,
|
|
logo: workspace.logo,
|
|
});
|
|
|
|
export const mapToGqlWorkspace = (
|
|
workspace: Workspace,
|
|
): GraphqlMutationWorkspace => workspace;
|