Sha256: 1938285e2e1128fd95661aee681519366ed9e1af864a6b37cbf42c1ca1b95a71

Contents?: true

Size: 660 Bytes

Versions: 6

Compression:

Stored size: 660 Bytes

Contents

module Tr3llo
  module Command
    module Card
      module EditItem
        extend self

        def execute(card_key, item_key)
          card_id = Entities.parse_id(:card, card_key)
          item_id = Entities.parse_id(:check_item, item_key)

          item = API::Checklist.get_item(card_id, item_id)

          interface = Application.fetch_interface!()

          interface.print_frame do
            name = interface.input.ask("Item name:", required: true, value: item.name)

            API::Checklist.update_item(card_id, item_id, name: name)

            interface.puts("Item has been updated")
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
3llo-1.3.1 lib/3llo/command/card/edit_item.rb
3llo-1.3.1.pre.rc.0 lib/3llo/command/card/edit_item.rb
3llo-1.2.0 lib/3llo/command/card/edit_item.rb
3llo-1.1.0 lib/3llo/command/card/edit_item.rb
3llo-1.0.0 lib/3llo/command/card/edit_item.rb
3llo-1.0.0.pre.rc.0 lib/3llo/command/card/edit_item.rb