Skip to content

Commit

Permalink
add fields and fix Template.generate_documents
Browse files Browse the repository at this point in the history
  • Loading branch information
genaromadrid committed Jan 29, 2018
1 parent 466ca3a commit 85d61b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/mifiel/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ class Template < Mifiel::Base
put :save, '/templates/:id'
post :create, '/templates'
delete :delete, '/templates/:id'
get :fields, '/templates/:id/fields'

def generate_document(args = {})
Mifiel::Document.create_from_template(args.merge(template_id: id))
end

def generate_documents(callback_url:, identifier: nil, documents:)
def generate_documents(callback_url:, documents:, identifier: nil)
Mifiel::Document.create_many_from_template(
template_id: template_id,
template_id: id,
identifier: identifier,
documents: documents,
callback_url: callback_url
Expand Down

0 comments on commit 85d61b5

Please sign in to comment.