import request from './request';

export const getUploadAssets = (params) => {
  return request.get('/b/uploads', { params });
};

export const uploadAsset = (file, hospitalId) => {
  const formData = new FormData();
  formData.append('file', file);
  if (hospitalId) {
    formData.append('hospitalId', String(hospitalId));
  }

  return request.post('/b/uploads', formData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
};
