feat: Refactoring route declarations.
This commit is contained in:
@@ -22,10 +22,10 @@ enum Button {
|
||||
}
|
||||
|
||||
@Sendable
|
||||
static func close(id: IDKey, resetURL route: ViewRoute? = nil) -> some HTML<HTMLTag.button> {
|
||||
static func close(id: IDKey, resetURL route: SiteRoute.View? = nil) -> some HTML<HTMLTag.button> {
|
||||
close(
|
||||
id: id.description,
|
||||
resetURL: route != nil ? ViewRoute.router.path(for: route!) : nil
|
||||
resetURL: route != nil ? SiteRoute.View.router.path(for: route!) : nil
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ extension Float where B == DefaultCloseButton {
|
||||
init(
|
||||
id: String = "float",
|
||||
shouldDisplay: Bool,
|
||||
resetURL route: ViewRoute? = nil,
|
||||
resetURL route: SiteRoute.View? = nil,
|
||||
@HTMLBuilder body: () -> C
|
||||
) {
|
||||
self.init(
|
||||
@@ -71,7 +71,7 @@ extension Float where B == DefaultCloseButton {
|
||||
body: body,
|
||||
closeButton: { DefaultCloseButton(
|
||||
id: id,
|
||||
resetURL: route != nil ? ViewRoute.router.path(for: route!) : nil
|
||||
resetURL: route != nil ? SiteRoute.View.router.path(for: route!) : nil
|
||||
) }
|
||||
)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import Vapor
|
||||
struct EmployeeSelect: HTML, Sendable {
|
||||
|
||||
let employees: [Employee]?
|
||||
let context: ViewRoute.SelectContext
|
||||
let context: SiteRoute.View.SelectContext
|
||||
|
||||
var content: some HTML {
|
||||
if let employees {
|
||||
@@ -42,7 +42,7 @@ struct EmployeeSelect: HTML, Sendable {
|
||||
|
||||
struct VendorBranchSelect: HTML, Sendable {
|
||||
let branches: [VendorBranch.Detail]?
|
||||
let context: ViewRoute.SelectContext
|
||||
let context: SiteRoute.View.SelectContext
|
||||
|
||||
var content: some HTML {
|
||||
if let branches {
|
||||
@@ -79,7 +79,7 @@ struct VendorBranchSelect: HTML, Sendable {
|
||||
// case purchaseOrderForm
|
||||
// case purchaseOrderSearch
|
||||
|
||||
extension ViewRoute.SelectContext {
|
||||
extension SiteRoute.View.SelectContext {
|
||||
var classString: String {
|
||||
switch self {
|
||||
case .purchaseOrderForm: return "col-3"
|
||||
|
||||
Reference in New Issue
Block a user