Skip to content
Snippets Groups Projects

Tag

Closed vincent.steinman requested to merge tag into main
10 files
+ 233
4
Compare changes
  • Side-by-side
  • Inline
Files
10
import CommanderCommand from '../../CommanderCommand';
import SessionManager from '../../../managers/SessionManager';
import DojoBackendManager from "../../../managers/DojoBackendManager";
import Tags from '../../../sharedByClients/models/Tag';
class TagAddCommand extends CommanderCommand {
protected commandName: string = 'add';
protected defineCommand() {
this.command
.description('Add a tag')
.argument('<tagName>', 'name of the tag') //test
.argument('<tagType>', 'type of the tag')
.action(this.commandAction.bind(this));
}
protected async commandAction(name : string, type: string): Promise<void> {
let tag : Tags | undefined;
{
if ( !await SessionManager.testSession(true, null) ) {
return;
}
tag = await DojoBackendManager.addTag(name, type);
if ( !tag ) {
return;
}
}
}
}
export default new TagAddCommand();
\ No newline at end of file
Loading