@velaro/cli 1.4.214 → 1.4.215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/contacts.js +13 -1
- package/package.json +1 -1
package/lib/commands/contacts.js
CHANGED
|
@@ -171,6 +171,12 @@ async function addTagHandler(argv) {
|
|
|
171
171
|
console.log(result.success ? `\n✅ Tag ${argv.tagId} added to contact #${argv.id}.\n` : '\nFailed to add tag.\n');
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
// DELETE Contacts/{id}/Tags/{tagId} -> ContactsController.RemoveTag
|
|
175
|
+
async function removeTagHandler(argv) {
|
|
176
|
+
const result = await request('DELETE', `Contacts/${argv.id}/Tags/${argv.tagId}`);
|
|
177
|
+
console.log(result && result.success ? `\nTag ${argv.tagId} removed from contact #${argv.id}.\n` : '\nFailed to remove tag.\n');
|
|
178
|
+
}
|
|
179
|
+
|
|
174
180
|
const tagsCommand = {
|
|
175
181
|
command: 'tags <subcommand>',
|
|
176
182
|
describe: 'Manage contact tags',
|
|
@@ -182,7 +188,13 @@ const tagsCommand = {
|
|
|
182
188
|
builder: (y2) => y2.positional('id', { type: 'number' }).positional('tagId', { type: 'number' }),
|
|
183
189
|
handler: runCommand(addTagHandler),
|
|
184
190
|
})
|
|
185
|
-
.
|
|
191
|
+
.command({
|
|
192
|
+
command: 'remove <id> <tagId>',
|
|
193
|
+
describe: 'Remove a tag from a contact',
|
|
194
|
+
builder: (y2) => y2.positional('id', { type: 'number' }).positional('tagId', { type: 'number' }),
|
|
195
|
+
handler: runCommand(removeTagHandler),
|
|
196
|
+
})
|
|
197
|
+
.demandCommand(1, 'Specify a tags subcommand: list | add | remove'),
|
|
186
198
|
handler: () => {},
|
|
187
199
|
};
|
|
188
200
|
|
package/package.json
CHANGED