import { useMutation, useQueryClient, } from '@tanstack/react-query';
import { NullSeamClientError, useSeamClient } from '../../../lib/seam/use-seam-client.js';
export function useCreateAccessCode() {
    const { client } = useSeamClient();
    const queryClient = useQueryClient();
    return useMutation({
        mutationFn: async (mutationParams) => {
            if (client === null)
                throw new NullSeamClientError();
            return await client.accessCodes.create(mutationParams);
        },
        onSuccess: () => {
            void queryClient.invalidateQueries(['access_codes', 'list']);
        },
    });
}
//# sourceMappingURL=use-create-access-code.js.map