Skip to content

Make accountId required in all API resource constructors #90

@coderabbitai

Description

@coderabbitai

Problem

Currently, the accountId parameter is optional in resource class constructors (e.g., ContactFields, Contacts, etc.), but it's used directly in URL template construction. This can lead to malformed URLs like /api/accounts/undefined/contacts/fields when accountId is not provided.

Proposed Solution

Make accountId a required parameter (remove the ?) in all resource class constructors under src/lib/api/resources/ to enforce compile-time safety and prevent runtime URL construction errors.

Affected Files

All resource classes in:

  • src/lib/api/resources/

This change should be applied consistently across the codebase to ensure all resources validate the presence of accountId at compile time.

Context

This issue was identified during the review of PR #89.

Related PR: #89
Related Comment: #89 (comment)
Reported by: @narekhovhannisyan

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions