feat: Updates styles in css and views.
This commit is contained in:
@@ -15,6 +15,7 @@ struct ApiController: RouteCollection {
|
||||
|
||||
proCon.get(use: prosAndConsIndex(req:))
|
||||
proCon.post(use: createProCon(req:))
|
||||
proCon.delete(":id", use: deleteProCon(req:))
|
||||
|
||||
utils.post("check-words", use: checkWords(req:))
|
||||
}
|
||||
@@ -44,6 +45,19 @@ struct ApiController: RouteCollection {
|
||||
return proCon
|
||||
}
|
||||
|
||||
@Sendable
|
||||
func deleteProCon(req: Request) async throws -> HTTPStatus {
|
||||
guard let idString = req.parameters.get("id"),
|
||||
let id = UUID(uuidString: idString)
|
||||
else {
|
||||
throw Abort(.badRequest)
|
||||
}
|
||||
try await ProCon.query(on: req.db)
|
||||
.filter(\.$id == id)
|
||||
.delete()
|
||||
return .ok
|
||||
}
|
||||
|
||||
@Sendable
|
||||
func checkWords(req: Request) async throws -> HTTPStatus {
|
||||
let input = try req.content.decode(CheckWords.self)
|
||||
|
||||
Reference in New Issue
Block a user