/**
 * Brevo connection resource.
 *
 * fetchLists/fetchAttributes read the server-side cache and never trigger an
 * API call; only testConnection and refresh reach Brevo, and both exist to
 * serve an explicit button press.
 */

import { get, post } from './client';

export const testConnection = () => post( '/brevo/test', {} );

export const refreshFromBrevo = () => post( '/brevo/refresh', {} );

export const fetchLists = () => get( '/brevo/lists' );

export const fetchAttributes = () => get( '/brevo/attributes' );

export const createAttribute = ( label, type ) =>
	post( '/brevo/attributes', { label, type } );
