How can i use a struct in a context object

Example:

struct CreateMatchMakingDataContext: Codable {

let title: String
let user: User
let fullName: String

let schools: [SchoolData]
let provinces: [String]
let timeZones: [String]
let orders: [String]
let interpreters: [String]

}

struct SchoolData: Codable {

let name: String
let city: String
let province: String
let timeZone: String

}

When I set up the webpage for these objects:

func createMatchMakingDataHandler(_ request: Request) throws → Future {
return try request.parameters.next(User.self).flatMap(to: View.self) { user in

        let fullName = user.getFullName()
        
        let context = CreateMatchMakingDataContext(title: "Create Match Making Data for \(fullName)", user: user, fullName: fullName, schools: SchoolName.getSchools(), provinces: Province.getProvinces(), timeZones: TimeZones.getTimeZones(), orders:["1", "2"], interpreters: ["English", "French", "None"])
        
        return try request.leaf().render("createMatchMakingData", context)
    }
}

I get a crash :frowning:

Never mind, it’s my own bonehead’s fault in my leaf HTML. I didn’t separate the variables in the JS function.

Thanks for the update - really glad you managed to sort it out! :]