Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

652 B
Raw Blame
import { authClient } from "@/lib/auth-client";

type UpdateWorkspaceRequest = {
  id: string;
  name: string;
  description?: string;
  logo?: string;
  slug?: string;
};

const updateWorkspace = async ({
  id,
  name,
  description,
  logo,
  slug,
}: UpdateWorkspaceRequest) => {
  const metadata = description ? { description } : undefined;

  const { data, error } = await authClient.organization.update({
    organizationId: id,
    data: {
      name,
      slug,
      logo,
      metadata,
    },
  });

  if (error) {
    throw new Error(error.message || "Failed to update workspace");
  }

  return data;
};

export default updateWorkspace;