From 82b32d4b26a7d38dc0629499808934fefff3891c Mon Sep 17 00:00:00 2001 From: Beau Raines Date: Sun, 24 Nov 2024 19:58:48 -0800 Subject: [PATCH] feat: add time entry command will use default project if none provided (#204) if no `-p` is provided wiht the command, it will add the time entry using the default project --- cmds/addTimeEntry.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmds/addTimeEntry.mjs b/cmds/addTimeEntry.mjs index 9e52384..eff77ae 100644 --- a/cmds/addTimeEntry.mjs +++ b/cmds/addTimeEntry.mjs @@ -1,6 +1,6 @@ /* eslint-disable no-unused-expressions */ import Client from '../client.js' -import { defaultWorkspaceId, getProjectByName, getProjectById, appName, displayTimeEntry, parseTime } from '../utils.js' +import { defaultProjectId, defaultWorkspaceId, getProjectByName, getProjectById, appName, displayTimeEntry, parseTime } from '../utils.js' import dayjs from 'dayjs' import debugClient from 'debug' import utc from 'dayjs/plugin/utc.js' @@ -32,6 +32,8 @@ export const handler = async function (argv) { } else { project = await getProjectById(params.workspace_id, argv.projectId) } + } else { + project = await getProjectById(params.workspace_id, defaultProjectId ) } let startTime, endTime