summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@protonmail.com>2023-12-23 17:31:31 -0500
committerPuyodead1 <puyodead@protonmail.com>2023-12-23 17:31:31 -0500
commitcf34ab167477a1fd86f017f2aee7ec1e849e8a05 (patch)
treeab156e94b03fea8b76996f64de323d1644a018aa /src/api
parentupdate pomelo experiment (diff)
downloadserver-ts-cf34ab167477a1fd86f017f2aee7ec1e849e8a05.tar.xz
rename unique uesrname response and schema
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/unique-username/username-attempt-unauthed.ts11
-rw-r--r--src/api/routes/unique-username/username-suggestions-unauthed.ts4
2 files changed, 9 insertions, 6 deletions
diff --git a/src/api/routes/unique-username/username-attempt-unauthed.ts b/src/api/routes/unique-username/username-attempt-unauthed.ts

index 3af1fa88..b225a299 100644 --- a/src/api/routes/unique-username/username-attempt-unauthed.ts +++ b/src/api/routes/unique-username/username-attempt-unauthed.ts
@@ -1,5 +1,5 @@ import { route } from "@spacebar/api"; -import { Config, User, UsernameAttemptUnauthedSchema } from "@spacebar/util"; +import { Config, UniqueUsernameAttemptSchema, User } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; const router = Router(); @@ -7,15 +7,16 @@ const router = Router(); router.post( "/", route({ - requestBody: "UsernameAttemptUnauthedSchema", + requestBody: "UniqueUsernameAttemptSchema", responses: { - 200: { body: "UsernameAttemptResponse" }, + 200: { body: "UniqueUsernameAttemptResponse" }, 400: { body: "APIErrorResponse" }, }, - description: "Check if a username is available", + description: + "Checks whether a unique username is available for the user to claim.", }), async (req: Request, res: Response) => { - const body = req.body as UsernameAttemptUnauthedSchema; + const body = req.body as UniqueUsernameAttemptSchema; const { uniqueUsernames } = Config.get().general; if (!uniqueUsernames) { throw new HTTPError( diff --git a/src/api/routes/unique-username/username-suggestions-unauthed.ts b/src/api/routes/unique-username/username-suggestions-unauthed.ts
index 9b112b55..2ce09285 100644 --- a/src/api/routes/unique-username/username-suggestions-unauthed.ts +++ b/src/api/routes/unique-username/username-suggestions-unauthed.ts
@@ -1,12 +1,14 @@ import { route } from "@spacebar/api"; +import { Config } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; -import { Config } from "../../../util"; const router = Router(); router.get( "/", route({ + description: + "Returns a suggested unique username string based on the current user's username.", query: { global_name: { type: "string",