We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c94abc commit e378944Copy full SHA for e378944
1 file changed
src/server/routes/api/server/folder.ts
@@ -20,7 +20,7 @@ export default typedPlugin(
20
PATH,
21
{
22
schema: {
23
- description: 'Fetch a folder by ID. Behavior varies based on public and allowUploads flags.',
+ description: 'Fetch a folder by ID/name. Behavior varies based on public and allowUploads flags.',
24
params: z.object({
25
id: z.string(),
26
}),
@@ -45,8 +45,10 @@ export default typedPlugin(
45
async (req, res) => {
46
const { id } = req.params;
47
48
- const folder = await prisma.folder.findUnique({
49
- where: { id },
+ const folder = await prisma.folder.findFirst({
+ where: {
50
+ OR: [{ id }, { name: id }],
51
+ },
52
include: {
53
children: {
54
where: { public: true },
0 commit comments