Removing Prisma and Grapql-nestjs-prisma resolvers (#2574)

* Some cleaning

* Fix seeds

* Fix all sign in, sign up flow and apiKey optimistic rendering

* Fix
This commit is contained in:
Charles Bochet
2023-11-19 18:25:47 +01:00
committed by GitHub
parent 18dac1a2b6
commit f5e1d7825a
616 changed files with 2220 additions and 23073 deletions

View File

@ -3,7 +3,6 @@ import { v4 as uuidv4 } from 'uuid';
import { useSpreadsheetImport } from '@/spreadsheet-import/hooks/useSpreadsheetImport';
import { SpreadsheetOptions } from '@/spreadsheet-import/types';
import { useSnackBar } from '@/ui/feedback/snack-bar/hooks/useSnackBar';
import { useInsertManyPersonMutation } from '~/generated/graphql';
import { fieldsForPerson } from '../utils/fieldsForPerson';
@ -13,8 +12,6 @@ export const useSpreadsheetPersonImport = () => {
const { openSpreadsheetImport } = useSpreadsheetImport<FieldPersonMapping>();
const { enqueueSnackBar } = useSnackBar();
const [createManyPerson] = useInsertManyPersonMutation();
const openPersonSpreadsheetImport = (
options?: Omit<
SpreadsheetOptions<FieldPersonMapping>,
@ -37,22 +34,23 @@ export const useSpreadsheetPersonImport = () => {
city: person.city as string | undefined,
}));
try {
const result = await createManyPerson({
variables: {
data: createInputs,
},
refetchQueries: 'active',
});
// TODO : abstract this part for any object
// try {
// const result = await createManyPerson({
// variables: {
// data: createInputs,
// },
// refetchQueries: 'active',
// });
if (result.errors) {
throw result.errors;
}
} catch (error: any) {
enqueueSnackBar(error?.message || 'Something went wrong', {
variant: 'error',
});
}
// if (result.errors) {
// throw result.errors;
// }
// } catch (error: any) {
// enqueueSnackBar(error?.message || 'Something went wrong', {
// variant: 'error',
// });
// }
},
fields: fieldsForPerson,
});