package User

import (
	"net/http"

	"astrology-api/services"

	"github.com/gin-gonic/gin"
)

//
// Get All System Flags
//

func GetSystemFlag(c *gin.Context) {

	response, err := services.GetSystemFlags()

	if err != nil {

		c.JSON(http.StatusInternalServerError, gin.H{
			"error":   false,
			"message": err.Error(),
			"status":  500,
		})

		return
	}

	c.JSON(http.StatusOK, response)
}

//
// Get Sub Category
//

func GetSubCategory(c *gin.Context) {

	response, err := services.GetSubCategories()

	if err != nil {

		c.JSON(http.StatusInternalServerError, gin.H{
			"error":   false,
			"message": err.Error(),
			"status":  500,
		})

		return
	}

	c.JSON(http.StatusOK, response)
}

//
// Get App Language
//

func GetAppLanguage(c *gin.Context) {

	response, err := services.GetAppLanguages()

	if err != nil {

		c.JSON(http.StatusInternalServerError, gin.H{
			"error":   false,
			"message": err.Error(),
			"status":  500,
		})

		return
	}

	c.JSON(http.StatusOK, response)
}
