Address

useGetCountriesQuery

This function is used to fetch countries from Omnitron.

The useGetCountriesQuery function is imported from '@akinon/next/data/client/address'.

import { useGetCountriesQuery } from '@akinon/next/data/client/address';

To use the function, create a variable and list the countries.

const { data: country } = useGetCountriesQuery();

Data returned from the function:

  • count: Provides the total count of added countries.

  • next: Used for pagination. If the user is on the 2nd page, it contains the URL of the 3rd page.

  • previous: Used for pagination. If the user is on the 2nd page, it contains the URL of the 1st page.

{
	"count": 1,
	"next": null,
	"previous": null,
	"results": [{
			"pk": 1,
			"is_active": true,
			"name": "Türkiye",
			"code": "TR",
			"translations": null
		},
		{
			"pk": 1,
			"is_active": true,
			"name": "United States",
			"code": "USA",
			"translations": null
		}
	]
}

useGetCitiesQuery

This function is used to fetch cities from Omnitron.

The useGetCitiesQuery function is imported from '@akinon/next/data/client/address'.

To use the function, selected country data needs to be sent to the useGetCitiesQuery function.

Data returned from the function:

useGetTownshipsQuery

This function is used to fetch townships from Omnitron.

The useGetTownshipsQuery function is imported from '@akinon/next/data/client/address'.

To use the function, selected city data needs to be sent to the useGetTownshipsQuery function.

Data returned from the function:

useGetDistrictsQuery

This function is used to fetch districts from Omnitron.

The useGetDistrictsQuery function is imported from '@akinon/next/data/client/address'.

To use the function, selected township data needs to be sent to the useGetDistrictsQuery function.

Data returned from the function:

useGetAddressesQuery

This function is used to fetch the addresses saved by the user.

The useGetAddressesQuery function is imported from '@akinon/next/data/client/address'.

To use the function, create a variable and call the function.

const { data, isLoading, isSuccess } = useGetAddressesQuery();

Data returned from the function:

useGetRetailStoreQuery

This function is used to fetch the cities where a product is available in stores.

The useGetRetailStoreQuery function is imported from '@akinon/next/data/client/address'.

To use the function, create a variable and call the function.

Data returned from the function:

useGetRetailStoreCitiesQuery

This function is used to fetch city information for stores from Omnitron.

The useGetRetailStoreCitiesQuery function is imported from '@akinon/next/data/client/address'.

To use this function, selected country data needs to be sent to the useGetRetailStoreCitiesQuery function.

Data returned from the function:

useGetStoresQuery

This function is used to fetch a list of stores from Omnitron.

The useGetStoresQuery function is imported from '@akinon/next/data/client/address'.

To use the function, create a variable and call the function.

Data returned from the function:

useGetRetailStoreTownshipsQuery

This function is used to fetch the townships of retail stores.

The useGetRetailStoreTownshipsQuery function is imported from '@akinon/next/data/client/address'.

To use the function, create a variable and provide the selected city information to the function.

Data returned from the function:

Was this helpful?