text: /* global $ */
  'use strict';
  
  const api = {
    
    search: function (query) {
      return $.ajax({
        type: 'GET',
        url: '/api/notes/',
        dataType: 'json',
        data: query,
      });
    },
    
    details: function (id) {
      return $.ajax({
        type: 'GET',
        dataType: 'json',
        url: `/api/notes/${id}`,
      });
    },
  
    update: function(id, obj) {
      return $.ajax({
        type: 'PUT',
        url: `/api/notes/${id}`,
        contentType: 'application/json',
        dataType: 'json',
        data: JSON.stringify(obj),
      });
    },
  
    create: function(obj) {
      return $.ajax({
        type: 'POST',
        url: '/api/notes/',
        contentType: 'application/json',
        dataType: 'json',
        processData: false,
        data: JSON.stringify(obj),
      });
    },
  
    delete: function(id) {
      return $.ajax({
        type: 'DELETE',
        url: `/api/notes/${id}`,
        contentType: 'application/json',
        dataType: 'json',
      });
    }
  }; 
  
    
  
  
  