From 28c781e48983f60c3ee0237de19a48b10771ab80 Mon Sep 17 00:00:00 2001 From: Shagit Ziganshin <3687591+theLastOfCats@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:57:24 +0300 Subject: [PATCH] fix fortune template --- frameworks/Swift/vapor/vapor-swifql/Package.swift | 2 -- .../Sources/Extensions/Models+Content.swift | 10 +++++++++- .../vapor-swifql/Sources/Resources/Views/fortune.leaf | 10 ---------- .../Swift/vapor/vapor-swifql/Sources/configure.swift | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) delete mode 100644 frameworks/Swift/vapor/vapor-swifql/Sources/Resources/Views/fortune.leaf diff --git a/frameworks/Swift/vapor/vapor-swifql/Package.swift b/frameworks/Swift/vapor/vapor-swifql/Package.swift index 4816285eb7bf..43d9104cecd5 100644 --- a/frameworks/Swift/vapor/vapor-swifql/Package.swift +++ b/frameworks/Swift/vapor/vapor-swifql/Package.swift @@ -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 ) ] diff --git a/frameworks/Swift/vapor/vapor-swifql/Sources/Extensions/Models+Content.swift b/frameworks/Swift/vapor/vapor-swifql/Sources/Extensions/Models+Content.swift index 933b651dcd31..e88609b5a29a 100644 --- a/frameworks/Swift/vapor/vapor-swifql/Sources/Extensions/Models+Content.swift +++ b/frameworks/Swift/vapor/vapor-swifql/Sources/Extensions/Models+Content.swift @@ -8,4 +8,12 @@ import Vapor extension World: Content {} -extension Fortune: Content {} \ No newline at end of file +extension Fortune: Content {} + +struct Fortunes: Codable { + var fortunes: [Fortune] + + init(_ fortunes: [Fortune]) { + self.fortunes = fortunes + } +} \ No newline at end of file diff --git a/frameworks/Swift/vapor/vapor-swifql/Sources/Resources/Views/fortune.leaf b/frameworks/Swift/vapor/vapor-swifql/Sources/Resources/Views/fortune.leaf deleted file mode 100644 index 36c7a7ac9662..000000000000 --- a/frameworks/Swift/vapor/vapor-swifql/Sources/Resources/Views/fortune.leaf +++ /dev/null @@ -1,10 +0,0 @@ - - -
id | message |
---|---|
#(fortune.id) | #(fortune.message) |