53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# File 'lib/wiq/commands/prospect_families.rb', line 53
def list
params = { "per_page" => 50 }
if options[:query]
params["query"] = options[:query]
else
params["attention_mode"] = options[:attention] if options[:attention]
params["stage"] = options[:stage] if options[:stage]
if options[:assigned_to_me]
params["assigned_to"] = "me"
elsif options[:assigned_coach]
params["assigned_coach_id"] = options[:assigned_coach]
end
if options[:question_id] && options[:answer_value]
params["question_id"] = options[:question_id]
params["answer_value"] = options[:answer_value]
elsif options[:question_id] || options[:answer_value]
raise Wiq::Error.new("--question-id and --answer-value must be passed together.",
code: "missing_question_pair")
end
end
params["sort"] = options[:sort] if options[:sort]
records, total = fetch_index("/api/v1/prospect_families", params, key: "prospect_families")
render_index(
records, total: total,
summary: "Listed #{records.size} prospect families.",
breadcrumbs: [
{ "cmd" => "wiq prospect_families show <id>", "description" => "Drill into one family" },
{ "cmd" => "wiq prospect_families notes <id>", "description" => "See contact log" },
{ "cmd" => "wiq prospects summary", "description" => "Pipeline dashboard" }
]
)
end
|