···1010 await appProcess.start();
11111212 // Only start event worker in same process when using in-memory events
1313- const useInMemoryEvents = process.env.USE_IN_MEMORY_EVENTS === 'true';
1313+ const useInMemoryEvents = configService.shouldUseInMemoryEvents();
1414 if (useInMemoryEvents) {
1515 console.log('Starting in-memory event worker in the same process...');
1616 const inMemoryWorkerProcess = new InMemoryEventWorkerProcess(configService);
···11+export type { ILockService } from './ILockService';
22+export { RedisLockService } from './RedisLockService';
33+export { InMemoryLockService } from './InMemoryLockService';
44+export { LockServiceFactory } from './LockServiceFactory';
···11-import { ApiClient } from '@/api-client/ApiClient';
21import { useMutation, useQueryClient } from '@tanstack/react-query';
22+import { createCollection } from '../dal';
33+import { collectionKeys } from '../collectionKeys';
3445export default function useCreateCollection() {
55- const apiClient = new ApiClient(
66- process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000',
77- );
88-96 const queryClient = useQueryClient();
107118 const mutation = useMutation({
129 mutationFn: (newCollection: { name: string; description: string }) => {
1313- return apiClient.createCollection(newCollection);
1010+ return createCollection(newCollection);
1411 },
15121613 // Do things that are absolutely necessary and logic related (like query invalidation) in the useMutation callbacks
1714 // Do UI related things like redirects or showing toast notifications in mutate callbacks. If the user navigated away from the current screen before the mutation finished, those will purposefully not fire
1815 // https://tkdodo.eu/blog/mastering-mutations-in-react-query#some-callbacks-might-not-fire
1916 onSuccess: () => {
2020- queryClient.invalidateQueries({ queryKey: ['collections'] });
1717+ queryClient.invalidateQueries({ queryKey: collectionKeys.infinite() });
1818+ queryClient.refetchQueries({ queryKey: collectionKeys.mine() });
2119 },
2220 });
2321