import http from '../http'
import { https } from '../https'

export default {
  pageSampleKeep: data =>
    http.post('/v1/sample_keep/page-sample-keep', data).then(res => res),

  pageSampleKeepHis: data =>
    http.post('/v1/sample_keep/page-sample-keep-his', data).then(res => res),

  pageSampleMakeDetail: data =>
    http.post('/v1/sample_keep/page-sample-make-detail', data).then(res => res),

  getById: id => http.get('/v1/test_catalogue/' + id).then(res => res),
  edit: data =>
    http.put('/v1/test_catalogue?id=' + data.id, data.obj).then(res => res),
  add: data => http.post('/v1/sample/', data).then(res => res),
  addMaterialRegister: data =>
    http.post('/v1/sample/add-material-register', data).then(res => res),
  makeEnd: data =>
    https
      .post(
        '/v1/sample_keep/bath_sample_make_end?sampleId=' + data.sampleId,
        JSON.stringify(data)
      )
      .then(res => res),
  saveKeepInfo: data =>
    http
      .post('/v1/sample_keep/save-keep-info?ids=' + data.ids, data.obj)
      .then(res => res),
  bathHandleEnd: data =>
    http
      .post('/v1/sample_keep/bath_handle_end?ids=' + data.ids, data)
      .then(res => res)
}
