def get(self, id): book = _repository.get_by_id(id) if book is not None: return send_from_directory(book.file.path, book.file.file_name, as_attachment=True) else: return not_found()
def get(self, id): try: Indexer().index_book(id) return ok() except: return not_found()
def get(self, id): try: Indexer().start(id) return ok() except: return not_found()
def delete(self, id): result = _service.delete_by_id(id) return ok(id) if result else not_found()
def get(self, id): book = _repository.get_by_id(id) return book if book else not_found()