package mysqlquerybuilder

import (
	"fmt"

	"git.gocasts.ir/ebhomengo/niki/param"
)

func BuildSortQuery(sort param.SortRequest) string {
	if sort.Field == "" && sort.Direction == "" {
		return ""
	}

	return fmt.Sprintf("ORDER BY %s %s", sort.Field, sort.Direction)
}
