         let rawTags = request.data["inputTags"]?.array //as? [Node] ?? (request.data["inputTags"]?.array as? [String]).map { $0.makeNode() } ?? []
         let rawSlugUrl = request.data["inputSlugUrl"]?.string
         
+        // I must be able to inline all of this
         var tagsArray: [Node] = []
         
         if let tagsNodeArray = rawTags as? [Node] {

    func editPostPostHandler(request: Request, post: BlogPost) throws -> ResponseRepresentable {
        let rawTitle = request.data["inputTitle"]?.string
        let rawContents = request.data["inputPostContents"]?.string
        let rawTags = request.data["inputTags"]?.array as? [Node]
        let rawSlugUrl = request.data["inputSlugUrl"]?.string

        if let errors = validatePostCreation(title: rawTitle, contents: rawContents, slugUrl: rawSlugUrl) {
            return try viewFactory.createBlogPostView(uri: request.uri, errors: errors, title: rawTitle, contents: rawContents, slugUrl: rawSlugUrl, tags: rawTags, isEditing: true, postToEdit: post)
        }

        guard let title = rawTitle, let contents = rawContents, let slugUrl = rawSlugUrl else {

        }

        let existing = try post.tags()
        let existingStringArray = existing.map { $0.name }
        
        let newTagsStringArray = tagsArray.map { $0.string ?? "" }.filter { $0 != "" }

        // Work out new tags and tags to delete
        let existingSet:Set<String> = Set(existingStringArray)
        let newTagSet:Set<String> = Set(newTagsStringArray)

        let tagsToDelete = existingSet.subtracting(newTagSet)
        let tagsToAdd = newTagSet.subtracting(existingSet)

        for deleteTag in tagsToDelete {
            let tag = try BlogTag.query().filter("name", deleteTag).first()
            guard let tagToCleanUp = tag else {
                throw Abort.badRequest
            }
            try tagToCleanUp.deletePivot(for: post)
            if try tagToCleanUp.blogPosts().count == 0 {
                try tagToCleanUp.delete()
            }
        }

        for newTagString in tagsToAdd {
            try BlogTag.addTag(newTagString, to: post)
        }

        try post.save()

