Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

update types

Kiran K16e85cd0db25
diff --git a/apps/web/lib/folder/get-folder.ts b/apps/web/lib/folder/get-folder.ts
index 80031db056..59ce372832 100644
--- a/apps/web/lib/folder/get-folder.ts
+++ b/apps/web/lib/folder/get-folder.ts
@@ -1,16 +1,16 @@
import { prisma } from "@/lib/prisma";
import { DubApiError } from "../api/errors";
-import { FOLDER_PERMISSIONS } from "./constants";
import { canPerformActionOnFolder } from "./permissions";
+import { FolderPermission } from "./types";
export const getFolder = async ({
- folderId,
workspaceId,
userId,
+ folderId,
}: {
- folderId: string;
workspaceId: string;
userId: string;
+ folderId: string;
}) => {
const folder = await prisma.folder.findFirst({
where: {
@@ -52,15 +52,15 @@ export const getFolder = async ({
};
export const getFolderOrThrow = async ({
- folderId,
workspaceId,
userId,
+ folderId,
requiredPermission,
}: {
- folderId: string;
workspaceId: string;
userId: string;
- requiredPermission: (typeof FOLDER_PERMISSIONS)[number];
+ folderId: string;
+ requiredPermission: FolderPermission;
}) => {
const folder = await getFolder({
folderId,