chore: organize types
This commit is contained in:
@@ -2,11 +2,11 @@ import { z } from "zod"
|
||||
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
import { Embeds } from "@/types/requests/embeds"
|
||||
import {
|
||||
ContentEntries,
|
||||
DynamicContentComponents,
|
||||
} from "@/types/requests/myPages/accountpage"
|
||||
} from "@/types/components/myPages/myPage/enums"
|
||||
import { Embeds } from "@/types/requests/embeds"
|
||||
import { Edges } from "@/types/requests/utils/edges"
|
||||
import { RTEDocument } from "@/types/rte/node"
|
||||
|
||||
@@ -97,7 +97,10 @@ export type RteTextContent = Omit<TextContentRaw, "text_content"> & {
|
||||
}
|
||||
}
|
||||
|
||||
type AccountPageContentItem = DynamicContentRaw | ShortcutsRaw | RteTextContent
|
||||
export type AccountPageContentItem =
|
||||
| DynamicContentRaw
|
||||
| ShortcutsRaw
|
||||
| RteTextContent
|
||||
|
||||
const accountPageContentItem = z.discriminatedUnion("__typename", [
|
||||
accountPageShortcuts,
|
||||
|
||||
@@ -6,18 +6,15 @@ import { publicProcedure, router } from "@/server/trpc"
|
||||
import { getAccountPageInput } from "./input"
|
||||
import { type AccountPage, validateAccountPageSchema } from "./output"
|
||||
|
||||
import { ContentEntries } from "@/types/components/myPages/myPage/enums"
|
||||
import { Embeds } from "@/types/requests/embeds"
|
||||
import {
|
||||
ContentEntries,
|
||||
GetAccountPageData,
|
||||
} from "@/types/requests/myPages/accountpage"
|
||||
import { Edges } from "@/types/requests/utils/edges"
|
||||
import { RTEDocument } from "@/types/rte/node"
|
||||
|
||||
export const accountPageQueryRouter = router({
|
||||
get: publicProcedure.input(getAccountPageInput).query(async ({ input }) => {
|
||||
try {
|
||||
const response = await request<GetAccountPageData>(GetAccountPage, {
|
||||
const response = await request<AccountPage>(GetAccountPage, {
|
||||
locale: input.lang,
|
||||
url: input.url,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user