chore: Use types from the web package

This commit is contained in:
Faruk AYDIN
2024-01-15 13:30:48 +01:00
parent 7831f2925b
commit 159931a6ea
77 changed files with 934 additions and 378 deletions

View File

@@ -1,12 +1,12 @@
import * as React from 'react';
import { useLazyQuery } from '@apollo/client';
import { IUser } from '@automatisch/types';
import { IUser } from 'types';
import { GET_USER } from 'graphql/queries/get-user';
type QueryResponse = {
getUser: IUser;
}
};
export default function useUser(userId?: string) {
const [getUser, { data, loading }] = useLazyQuery<QueryResponse>(GET_USER);
@@ -15,14 +15,14 @@ export default function useUser(userId?: string) {
if (userId) {
getUser({
variables: {
id: userId
}
id: userId,
},
});
}
}, [userId]);
return {
user: data?.getUser,
loading
loading,
};
}