feat: align auth api with front convention (#370)
* feat: align auth api with front convention * fix: email password auth * fix: proper file naming * Fix login --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -11,7 +11,6 @@ import { GET_CURRENT_USER } from '@/users/services';
|
||||
import {
|
||||
GetCompaniesQuery,
|
||||
GetPeopleQuery,
|
||||
GetUsersQuery,
|
||||
SearchCompanyQuery,
|
||||
SearchUserQuery,
|
||||
} from '~/generated/graphql';
|
||||
@ -73,19 +72,9 @@ export const graphqlMocks = [
|
||||
);
|
||||
}),
|
||||
graphql.query(getOperationName(GET_CURRENT_USER) ?? '', (req, res, ctx) => {
|
||||
const customWhere = {
|
||||
...req.variables.where,
|
||||
id: {
|
||||
equals: req.variables.uuid,
|
||||
},
|
||||
};
|
||||
|
||||
const returnedMockedData = filterAndSortData<
|
||||
GetUsersQuery['findManyUser'][0]
|
||||
>(mockedUsersData, customWhere, req.variables.orderBy, req.variables.limit);
|
||||
return res(
|
||||
ctx.data({
|
||||
users: returnedMockedData,
|
||||
users: [mockedUsersData[0]],
|
||||
}),
|
||||
);
|
||||
}),
|
||||
|
||||
@ -4,6 +4,7 @@ import { ApolloProvider } from '@apollo/client';
|
||||
import { RecoilRoot } from 'recoil';
|
||||
|
||||
import { DefaultLayout } from '@/ui/layout/DefaultLayout';
|
||||
import { UserProvider } from '~/providers/user/UserProvider';
|
||||
|
||||
import { ComponentStorybookLayout } from './ComponentStorybookLayout';
|
||||
import { FullHeightStorybookLayout } from './FullHeightStorybookLayout';
|
||||
@ -17,11 +18,13 @@ export function getRenderWrapperForPage(
|
||||
return (
|
||||
<RecoilRoot>
|
||||
<ApolloProvider client={mockedClient}>
|
||||
<MemoryRouter initialEntries={[currentPath]}>
|
||||
<FullHeightStorybookLayout>
|
||||
<DefaultLayout>{children}</DefaultLayout>
|
||||
</FullHeightStorybookLayout>
|
||||
</MemoryRouter>
|
||||
<UserProvider>
|
||||
<MemoryRouter initialEntries={[currentPath]}>
|
||||
<FullHeightStorybookLayout>
|
||||
<DefaultLayout>{children}</DefaultLayout>
|
||||
</FullHeightStorybookLayout>
|
||||
</MemoryRouter>
|
||||
</UserProvider>
|
||||
</ApolloProvider>
|
||||
</RecoilRoot>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user