import axios from '../bc-libs/api.request'

export const getUserLayoutColumns = (userId,pageKey) => {
  return axios.request({
    url: 'api/v1/layoutColumns/'+userId+'/'+pageKey,
    method: 'get'
  })
}

export const saveUserLayoutColumns = (userId,pageKey,layoutColumns) => {
  return new Promise((resolve, reject) => {
    axios.request({
      url: 'api/v1/layoutColumns/saveUserSetting',
      data: {layoutColumns: layoutColumns, userId: userId, pageKey: pageKey},
      method: 'POST',
    }).then(response => {
      resolve(response.data);
    }).catch(err => {
      reject(err)
    })
  })
}

