-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d948a6
commit 6575cdb
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,22 @@ paths: | |
$ref: "#/components/responses/SuccessMessage" | ||
"500": | ||
$ref: "#/components/responses/ErrorMessage" | ||
/user/{email}: | ||
delete: | ||
summary: Delete a user | ||
description: "Requires authentication via a Cloudflare WARP client | ||
\n\n | ||
Please login at [https://api.editor.planx.uk/user](https://api.editor.planx.uk/user)" | ||
tags: ["user"] | ||
parameters: | ||
- in: path | ||
name: email | ||
type: string | ||
format: email | ||
example: [email protected] | ||
description: Email address of the user to be deleted | ||
responses: | ||
"200": | ||
$ref: "#/components/responses/SuccessMessage" | ||
"500": | ||
$ref: "#/components/responses/ErrorMessage" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
import { Router } from "express"; | ||
import { usePlatformAdminAuth } from "../auth/middleware"; | ||
import { validate } from "../../shared/middleware/validate"; | ||
import { createUserSchema, createUser } from "./controller"; | ||
import { | ||
createUserSchema, | ||
createUser, | ||
deleteUserSchema, | ||
deleteUser, | ||
} from "./controller"; | ||
|
||
const router = Router(); | ||
|
||
router.use(usePlatformAdminAuth); | ||
router.put("/", validate(createUserSchema), createUser); | ||
router.delete("/:email", validate(deleteUserSchema), deleteUser); | ||
|
||
export default router; |