Skip to content

Commit

Permalink
🐛 Fix build webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Dec 5, 2023
1 parent 99a312e commit fad4d22
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const AddLinkedAccount = () => {
e.preventDefault(); // Prevent default form submission
mutate({
linked_user_origin_id: linkedUserIdentifier,
alias: selectedOrganisation,
alias: selectedOrganisation.value,
id_project: selectedProject
});
setShowNewLinkedUserDialog({open: false})
Expand Down
10 changes: 8 additions & 2 deletions apps/webapp/src/hooks/mutations/useDefineFieldMutation.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import config from '@/utils/config';
import { useMutation } from '@tanstack/react-query';
import toast from 'react-hot-toast';
import { DefineTargetFieldDto } from 'api';

interface IDefineTargetFieldDto{
object_type_owner: string;
name: string;
description: string;
data_type: string;
}

const useDefineFieldMutation = () => {
const defineField = async (data: DefineTargetFieldDto) => {
const defineField = async (data: IDefineTargetFieldDto) => {
const response = await fetch(`${config.API_URL}/field-mapping/define`, {
method: 'POST',
body: JSON.stringify(data),
Expand Down
10 changes: 6 additions & 4 deletions apps/webapp/src/hooks/mutations/useLinkedUserMutation.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import config from '@/utils/config';
import { useMutation } from '@tanstack/react-query';
import toast from 'react-hot-toast';
import { CreateLinkedUserDto } from 'api';


interface ICreateTargetFieldDto {
linked_user_origin_id: string;
alias: string;
id_project: string;
}
const useLinkedUserMutation = () => {
const addLinkedUser = async (linkedUserData: CreateLinkedUserDto) => {
const addLinkedUser = async (linkedUserData: ICreateTargetFieldDto) => {
const response = await fetch(`${config.API_URL}/linked-users/create`, {
method: 'POST',
body: JSON.stringify(linkedUserData),
Expand Down
10 changes: 7 additions & 3 deletions apps/webapp/src/hooks/mutations/useMapFieldMutation.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import config from '@/utils/config';
import { useMutation } from '@tanstack/react-query';
import toast from 'react-hot-toast';
import { MapFieldToProviderDto } from 'api';

interface IMapTargetFieldDto {
attributeId: string;
source_custom_field_id: string;
source_provider: string;
linked_user_id: string;
}

const useMapFieldMutation = () => {
const mapField = async (data: MapFieldToProviderDto) => {
const mapField = async (data: IMapTargetFieldDto) => {
const response = await fetch(`${config.API_URL}/field-mapping/map`, {
method: 'POST',
body: JSON.stringify(data),
Expand Down
8 changes: 5 additions & 3 deletions apps/webapp/src/hooks/mutations/useOrganisationMutation.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import config from '@/utils/config';
import { useMutation } from '@tanstack/react-query';
import toast from 'react-hot-toast';
import { CreateOrganizationDto } from 'api';


interface IOrgDto {
name: string;
stripe_customer_id: string;
}
const useOrganisationMutation = () => {
const addOrg = async (data: CreateOrganizationDto) => {
const addOrg = async (data: IOrgDto) => {
const response = await fetch(`${config.API_URL}/organisations/create`, {
method: 'POST',
body: JSON.stringify(data),
Expand Down
8 changes: 5 additions & 3 deletions apps/webapp/src/hooks/mutations/useProjectMutation.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import config from '@/utils/config';
import { useMutation } from '@tanstack/react-query';
import toast from 'react-hot-toast';
import { CreateProjectDto } from 'api';


interface IProDto {
name: string;
id_organization: string;
}
const useProjectMutation = () => {
const addProject = async (data: CreateProjectDto) => {
const addProject = async (data: IProDto) => {
const response = await fetch(`${config.API_URL}/projects/create`, {
method: 'POST',
body: JSON.stringify(data),
Expand Down
5 changes: 1 addition & 4 deletions packages/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
export * from '@prisma/client';
export * from './src/@core/field-mapping/dto/create-custom-field.dto';
export * from './src/@core/linked-users/dto/create-linked-user.dto';
export * from './src/@core/organisations/dto/create-organization.dto';
export * from './src/@core/projects/dto/create-project.dto';
//export * from './src/@core/utils/types';

0 comments on commit fad4d22

Please sign in to comment.