From 896832b89c5f7347c42f3745adcd17e6ba1b04bd Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Mon, 14 Apr 2025 10:51:40 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9C=20fix:=20Remove=20Steam=20account?= =?UTF-8?q?=20info=20repetition=20(#263)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description ## Summary by CodeRabbit - **New Features** - User profiles now display integrated Steam account information for a more consolidated view. - Accounts can now include associated teams and Steam account information. - **Refactor** - Streamlined the underlying data structures for user, machine, and Steam information to improve consistency and performance. - **Chores** - Updated database schemas and upgraded core dependencies, including the `remeda` and `vite` packages, while refining authentication settings for smoother operation. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/functions/src/api/account.ts | 10 +----- packages/functions/src/api/steam.ts | 47 --------------------------- 2 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 packages/functions/src/api/steam.ts diff --git a/packages/functions/src/api/account.ts b/packages/functions/src/api/account.ts index be79ade3..22691c44 100644 --- a/packages/functions/src/api/account.ts +++ b/packages/functions/src/api/account.ts @@ -49,18 +49,10 @@ export namespace AccountApi { "User not found", ); - const { id, email, name, polarCustomerID, avatarUrl, discriminator, steamAccounts } = currentUser - return c.json({ data: { - id, - name, - email, + ...currentUser, teams, - avatarUrl, - steamAccounts, - discriminator, - polarCustomerID, } }, 200); }, diff --git a/packages/functions/src/api/steam.ts b/packages/functions/src/api/steam.ts deleted file mode 100644 index c16de6a8..00000000 --- a/packages/functions/src/api/steam.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Hono } from "hono"; -import { ErrorResponses, Result } from "./common"; -import { Steam } from "@nestri/core/steam/index"; -import { describeRoute } from "hono-openapi"; -import { Examples } from "@nestri/core/examples"; -import { assertActor } from "@nestri/core/actor"; -import { ErrorCodes, VisibleError } from "@nestri/core/error"; - -export namespace SteamApi { - export const route = new Hono() - .get("/", - describeRoute({ - tags: ["Steam"], - summary: "Get Steam account information", - description: "Get the user's Steam account information", - responses: { - 200: { - content: { - "application/json": { - schema: Result( - Steam.Info.openapi({ - description: "The Steam account information", - example: Examples.Steam, - }), - ), - }, - }, - description: "Successfully got the Steam account information", - }, - 404: ErrorResponses[404], - 429: ErrorResponses[429], - } - }), - async (c) => { - const actor = assertActor("user"); - const steamInfo = await Steam.fromUserID(actor.properties.userID); - if (!steamInfo) - throw new VisibleError( - "not_found", - ErrorCodes.NotFound.RESOURCE_NOT_FOUND, - "Steam account information not found", - ); - - return c.json({ data: steamInfo }, 200); - } - ) -} \ No newline at end of file