{"size": 1310, "ext": "js", "max_stars_repo_path": "Backend_API/favouritesMethods.js", "max_stars_repo_name": "UTN-FRBA-Mobile/Alfred", "max_stars_repo_stars_event_min_datetime": "2018-09-15T14:36:52.000Z", "max_stars_repo_stars_event_max_datetime": "2018-09-15T14:36:52.000Z", "max_issues_repo_path": "Backend_API/favouritesMethods.js", "max_issues_repo_name": "UTN-FRBA-Mobile/Alfred", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Backend_API/favouritesMethods.js", "max_forks_repo_name": "UTN-FRBA-Mobile/Alfred", "max_forks_repo_forks_event_min_datetime": "2018-09-04T00:16:09.000Z", "max_forks_repo_forks_event_max_datetime": "2019-01-15T14:33:44.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 3, "avg_line_length": 28.4782608696, "max_line_length": 98, "alphanum_fraction": 0.5839694656}
import { Meteor } from 'meteor/meteor';
import { Favourites } from '../../../../lib/schemas/favourites';

if (Meteor.isServer) {
  Meteor.methods({
    'insertFavourite'(aFav) {
      console.log("Started insertFavourite");
      try {
        const newFavourite = Favourites.insertFavourite(aFav);
        return newFavourite;
      } catch (exception) {
        console.error("=== ERROR on insertFavourite ===");
        console.error(exception);
        console.trace();
        throw exception;
      }
    },
    'favourites.get'() {
      console.log("Started insertFavourite");
      try {
        const aFavourite = Favourites.get();
        return aFavourite;
      } catch (exception) {
        console.error("=== ERROR on favourites.get ===");
        console.error(exception);
        console.trace();
        throw exception;
      }
    },
    'favourites.test'(data) {
      console.log("Called favourites.test Endpoint");
      console.log(data);
      console.log(data.value);
      console.log(data.value.adentro);
      return {
        prueba: "El Endpoint de la API fue llamado exitosamente, abajo puede verificar sus datos",
        datos_originales_que_llegaron: data,
        value: data.value,
        adentro: {
          adentro: data.value.adentro
        }
      };
    },
  });
}
