Country Controller class.

This class is responsible for handling country-related requests, delegating the necessary operations to the CountryRepository.

Hierarchy

  • default

Constructors

Methods

  • Retrieve a list of all countries.

    Returns Promise<any>

    A promise that resolves with an object containing a success indicator and an array of countries.

    Async

    Function

    getAllCountries

  • Retrieve one country by its identifier.

    Parameters

    • data: string

      The identifier of the country to be retrieved.

    Returns Promise<any>

    A promise that resolves with an object indicating success and the retrieved Country document.

    Async

    Function

    getCountryById

  • Save new country.

    Parameters

    Returns Promise<any>

    A promise that resolves with an object indicating success and the saved Country document.

    Async

    Function

    saveCountry

  • Update one country by its ID.

    Parameters

    • data: CountryDocument

      The new data for the country.

    • id: string

      The ObjectId of the country to update.

    Returns Promise<any>

    A promise that resolves with an object containing a success indicator and the updated Country document.

    Async

    Function

    updateCountryById

Generated using TypeDoc