diff --git a/src/main/resources/openapi/api.yaml b/src/main/resources/openapi/api.yaml index 6e1c4382..82f8f3e5 100644 --- a/src/main/resources/openapi/api.yaml +++ b/src/main/resources/openapi/api.yaml @@ -303,22 +303,19 @@ components: type: object required: - id - - userId + - user - text - createdAt - visibility - url - sensitive - - apId properties: id: type: integer format: int64 readOnly: true - userId: - type: integer - format: int64 - readOnly: true + user: + $ref: "#/components/schemas/UserResponse" overview: type: string text: @@ -343,10 +340,6 @@ components: readOnly: true sensitive: type: boolean - apId: - type: string - format: url - readOnly: true PostRequest: type: object diff --git a/src/main/web/model/PostDetails.ts b/src/main/web/model/PostDetails.ts deleted file mode 100644 index 1aa7250c..00000000 --- a/src/main/web/model/PostDetails.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {PostResponse, UserResponse} from "../generated"; - -export type PostDetails = PostResponse & { - user: UserResponse -} diff --git a/src/main/web/organisms/Post.tsx b/src/main/web/organisms/Post.tsx index 9e9253dc..f3680354 100644 --- a/src/main/web/organisms/Post.tsx +++ b/src/main/web/organisms/Post.tsx @@ -2,10 +2,10 @@ import {Component, createSignal} from "solid-js"; import {Box, Card, CardActions, CardContent, CardHeader, IconButton, Menu, MenuItem, Typography} from "@suid/material"; import {Avatar} from "../atoms/Avatar"; import {Favorite, MoreVert, Reply, ScreenRotationAlt} from "@suid/icons-material"; -import {PostDetails} from "../model/PostDetails"; import {ShareScopeIndicator} from "../molecules/ShareScopeIndicator"; +import {PostResponse} from "../generated"; -export const Post: Component<{ post: PostDetails }> = (props) => { +export const Post: Component<{ post: PostResponse }> = (props) => { const [anchorEl, setAnchorEl] = createSignal(null) const open = () => Boolean(anchorEl()); const handleClose = () => { diff --git a/src/main/web/pages/TopPage.tsx b/src/main/web/pages/TopPage.tsx index 451000cd..95cf9983 100644 --- a/src/main/web/pages/TopPage.tsx +++ b/src/main/web/pages/TopPage.tsx @@ -3,7 +3,6 @@ import {MainPage} from "../templates/MainPage"; import {PostForm} from "../organisms/PostForm"; import {Stack} from "@suid/material"; import {DefaultApi} from "../generated"; -import {PostDetails} from "../model/PostDetails"; import {PostList} from "../templates/PostList"; import {ApiWrapper} from "../lib/ApiWrapper"; @@ -16,20 +15,7 @@ export const TopPage: Component = () => { - { - return { - ...value, - user: { - id: 1234, - createdAt: Date.now(), - domain: "test-hideout.usbharu.dev", - name: "test", - url: "https://test-hideout.usbharu.dev", - screenName: "test", - description: "" - } - } as PostDetails - }) ?? []}/> + ) diff --git a/src/main/web/templates/PostList.tsx b/src/main/web/templates/PostList.tsx index 2b9d0dad..f8f4fc1e 100644 --- a/src/main/web/templates/PostList.tsx +++ b/src/main/web/templates/PostList.tsx @@ -1,9 +1,9 @@ import {Component, For} from "solid-js"; import {CircularProgress} from "@suid/material"; import {Post} from "../organisms/Post"; -import {PostDetails} from "../model/PostDetails"; +import {PostResponse} from "../generated"; -export const PostList: Component<{ posts: PostDetails[] }> = (props) => { +export const PostList: Component<{ posts: PostResponse[] }> = (props) => { return ( }> {