feat: update workspace name

This commit is contained in:
Henry
2024-09-17 21:54:03 +01:00
parent a06500a949
commit 233e19276e
6 changed files with 142 additions and 7 deletions

View File

@@ -38,6 +38,20 @@ export const create = async (
return newWorkspace;
};
export const update = async (
db: SupabaseClient<Database>,
workspacePublicId: string,
name: string,
) => {
const { data, error } = await db
.from("workspace")
.update({ name })
.eq("publicId", workspacePublicId)
.is("deletedAt", null);
return data;
};
export const getByPublicId = async (
db: SupabaseClient<Database>,
workspacePublicId: string,