Skip to content

Migrate templates.go to use SDK TemplatesService - #60

Merged
jeremy merged 1 commit into
mainfrom
sdk-templates
Jan 26, 2026
Merged

Migrate templates.go to use SDK TemplatesService#60
jeremy merged 1 commit into
mainfrom
sdk-templates

Conversation

@jeremy

@jeremy jeremy commented Jan 26, 2026

Copy link
Copy Markdown
Member

Replace direct API calls with SDK TemplatesService methods:

  • List, Get, Create, Update, Delete for templates
  • CreateProject and GetConstruction for project construction
  • Use basecamp.Template and related types
  • Filter templates by status client-side

Replace direct API calls with SDK TemplatesService methods:
- List, Get, Create, Update, Delete for templates
- CreateProject and GetConstruction for project construction
- Use basecamp.Template and related types
- Filter templates by status client-side
@jeremy
jeremy merged commit ceb2e1e into main Jan 26, 2026
8 checks passed
@jeremy
jeremy deleted the sdk-templates branch January 26, 2026 02:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a780630606

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +60 to 61
templates, err := app.SDK.Templates().List(cmd.Context())
if err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve archived/trashed listing

If the Basecamp templates endpoint defaults to active-only when no status query is provided (which is why the old implementation passed ?status=...), calling Templates().List() without a status will return only active templates. In that case the CLI’s --status archived|trashed paths will silently return zero results because there are no archived/trashed items to filter. This would be a regression for users who rely on listing archived/trashed templates; consider using an SDK call that accepts status or falling back to the raw API when status != "active".

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in PR #73 - now uses raw API with status parameter for archived/trashed templates, since SDK List() only returns active.

jeremy added a commit that referenced this pull request Jan 26, 2026
Fixes for Codex review comments:

1. webhooks.go: Let server use default webhook types instead of hard-coding
   (PR #58 feedback)

2. templates.go: Use raw API for archived/trashed status since SDK List()
   only returns active templates (PR #60 feedback)

3. campfire.go: Validate ParseInt errors before DeleteLine to avoid
   silent 0 IDs (PR #64 feedback)

4. recordings.go: Add comment clarifying that Unarchive() works for both
   archived AND trashed recordings via status/active endpoint (PR #68)

5. files.go: Preserve SDK errors in auto-detect mode instead of masking
   auth/permission errors as "not found" (PR #70 feedback)
jeremy added a commit that referenced this pull request Jan 26, 2026
Fixes for Codex review comments:

1. webhooks.go: Let server use default webhook types instead of hard-coding
   (PR #58 feedback)

2. templates.go: Use raw API for archived/trashed status since SDK List()
   only returns active templates (PR #60 feedback)

3. campfire.go: Validate ParseInt errors before DeleteLine to avoid
   silent 0 IDs (PR #64 feedback)

4. recordings.go: Add comment clarifying that Unarchive() works for both
   archived AND trashed recordings via status/active endpoint (PR #68)

5. files.go: Preserve SDK errors in auto-detect mode instead of masking
   auth/permission errors as "not found" (PR #70 feedback)
jeremy added a commit that referenced this pull request Feb 19, 2026
Replace direct API calls with SDK TemplatesService methods:
- List, Get, Create, Update, Delete for templates
- CreateProject and GetConstruction for project construction
- Use basecamp.Template and related types
- Filter templates by status client-side
jeremy added a commit that referenced this pull request Feb 19, 2026
Fixes for Codex review comments:

1. webhooks.go: Let server use default webhook types instead of hard-coding
   (PR #58 feedback)

2. templates.go: Use raw API for archived/trashed status since SDK List()
   only returns active templates (PR #60 feedback)

3. campfire.go: Validate ParseInt errors before DeleteLine to avoid
   silent 0 IDs (PR #64 feedback)

4. recordings.go: Add comment clarifying that Unarchive() works for both
   archived AND trashed recordings via status/active endpoint (PR #68)

5. files.go: Preserve SDK errors in auto-detect mode instead of masking
   auth/permission errors as "not found" (PR #70 feedback)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant