Skip to content

Commit

Permalink
fix fortune template
Browse files Browse the repository at this point in the history
  • Loading branch information
theLastOfCats committed Jul 5, 2024
1 parent d29222a commit 28c781e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
2 changes: 0 additions & 2 deletions frameworks/Swift/vapor/vapor-swifql/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ let package = Package(
.product(name: "PostgresBridge", package: "PostgresBridge"),
.product(name: "IkigaJSON", package: "IkigaJSON"),
],
path: "Sources",
resources: [.process("Resources/Views/fortune.leaf")],
swiftSettings: swiftSettings
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@
import Vapor

extension World: Content {}
extension Fortune: Content {}
extension Fortune: Content {}

struct Fortunes: Codable {
var fortunes: [Fortune]

init(_ fortunes: [Fortune]) {
self.fortunes = fortunes
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public func routes(_ app: Application) throws {

fortunes.append(Fortune(id: 0, message: "Additional fortune added at request time."))

return try await req.view.render("fortune", fortunes)
return try await req.view.render("fortune", Fortunes(fortunes))
}
}

0 comments on commit 28c781e

Please sign in to comment.