mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-11 00:05:36 +02:00
🐜 fix: Remove Steam account info repetition (#263)
## Description <!-- Briefly describe the purpose and scope of your changes --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user