-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* added read folder dto * Made explicit that the endpoint can read both folder and top level folder content * Fix typo
- Loading branch information
1 parent
73a032c
commit b077cf3
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { z } from 'zod' | ||
|
||
export const readFolderOrTopLevelFolderSchema = z.object({ | ||
// Null resourceId indicates reading of top level folder in a site. | ||
siteId: z.string(), | ||
resourceId: z.string().nullable() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { readFolderOrTopLevelFolderSchema } from "~/schemas/folder"; | ||
import { protectedProcedure, router } from '~/server/trpc' | ||
|
||
|
||
export const folderRouter = router({ | ||
readFolderOrTopLevelFolder: protectedProcedure.input(readFolderOrTopLevelFolderSchema).query(async ({ input, ctx }) => { | ||
// TODO: Fill these in later | ||
const folderName: string = "" | ||
const children: {id: string, name: string, type: 'page' | 'folder'}[] = [] | ||
// Not sure if a backpointer is needed here | ||
const parentId: string = "" | ||
return { | ||
folderName, children, parentId | ||
} | ||
}) | ||
|
||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.