import { request } from "../../app/api.js";

export const listProjectFolders = () => request("/project-folders");

export const registerProjectWorkspace = (name, create) => request("/workspaces", {
  method: "POST",
  body: { name, create }
});

export const browseProjectFolders = (folderId = "") => request(`/folder-browser?folderId=${encodeURIComponent(folderId)}`);

export const createProjectFolder = (parentId, name) => request("/folder-browser/folders", {
  method: "POST",
  body: { parentId, name }
});

export const registerBrowsedWorkspace = (folderId) => request("/workspaces", {
  method: "POST",
  body: { folderId }
});
