Skip to content

Refactor: Use getChurchtoolsBaseUrl() in URL builder functions #31

Description

@bwl21

Task

Replace the duplicated base URL logic in churchtools.ts with the centralized getChurchtoolsBaseUrl() function.

Files to Update

  • src/services/churchtools.ts:
    • Line 197-202: getGroupUrl() function
    • Line 207-211: getAppointmentUrl() function

Current Pattern (Duplication)

const churchtoolsBaseUrl = import.meta.env.DEV
  ? import.meta.env.VITE_BASE_URL
  : window.location.origin

New Pattern (Centralized)

const churchtoolsBaseUrl = getChurchtoolsBaseUrl()

Why

  • Avoids code duplication
  • Ensures consistency across the codebase
  • Makes maintenance easier (change once, applies everywhere)
  • Already documented in AGENTS.md

Related

  • New function added in: src/services/churchtools.ts (line 7-9)
  • See: AGENTS.md Base URL Pattern section

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions