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:
@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user