<commit_before>import Files from '/imports/api/files/files';
import { logger } from '/imports/utils/logger';

Meteor.methods({
  'files.create'(doc) {
    logger.info(`METHOD[${Meteor.userId()}]: files.create`, doc);
    check(doc, Files.schema);
    // TODO: permissions
    return Files.insert(doc);
  },
  'files.delete'(id) {
    logger.info(`METHOD[${Meteor.userId()}]: files.delete`, id);
    check(id, String);
    // TODO: permissions
    throw new Meteor.Error('Not Yet implemented');
  },
});<commit_msg>File removal implementation<commit_after>import Files from '/imports/api/files/files';
import { logger } from '/imports/utils/logger';

Meteor.methods({
  'files.create'(doc) {
    logger.info(`METHOD[${Meteor.userId()}]: files.create`, doc);
    check(doc, Files.schema);
    // TODO: permissions
    return Files.insert(doc);
  },
  'files.delete'(id) {
    logger.info(`METHOD[${Meteor.userId()}]: files.delete`, id);
    check(id, String);
    // TODO: permissions
    const currentFile = Files.findOne(id);
    Files.Uploads.remove(currentFile.fileId);
    Files.remove(id);
    return;
    //throw new Meteor.Error('Not Yet implemented');
  },
});
{'fraction_non_alphanumeric': 0.18508997429305912, 'fraction_numerical': 0.0, 'mean_word_length': 3.8464730290456433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6618108', 'n_tokens_mistral': 380, 'n_tokens_neox': 379, 'n_words': 72}