/**
 * Form-source resource. Local reads of the installed form plugins.
 */

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

export const fetchForms = ( adapter = '' ) =>
	get( `/forms${ query( { adapter } ) }` );

export const fetchFields = ( adapter, formId ) =>
	get(
		`/forms/${ encodeURIComponent( adapter ) }/${ encodeURIComponent(
			formId
		) }/fields`
	);
