import api from './axios'

/**
 * Fetch all pagetemplates.
 * @returns {Promise}
 */
export const getAllTemplateApi  = () => api.get('/admin/pagetemplates/all')

/**
 * Create a new pagetemplates.
 * @param {Object} payload - templates data to be submitted.
 * @returns {Promise}
 */
export const addTemplateApi     = (payload) => api.post('/admin/pagetemplates/add', payload)


export const updateTemplateApi = (payload, id) => api.post(`/admin/pagetemplates/${id}`, payload)

/**
 * Delete a single pagetemplates by its ID.
 * @param {Number|String} id - templates ID.
 * @returns {Promise}
 */
export const deleteTemplateApi = (id) => api.post(`/admin/pagetemplates/delete/${id}`)
