mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
39 lines
615 B
TypeScript
39 lines
615 B
TypeScript
import { prisma } from '@documenso/prisma';
|
|
|
|
export type UpdatePublicProfileOptions = {
|
|
userId: number;
|
|
teamId: number;
|
|
data: {
|
|
bio?: string;
|
|
enabled?: boolean;
|
|
};
|
|
};
|
|
|
|
export const updateTeamPublicProfile = async ({
|
|
userId,
|
|
teamId,
|
|
data,
|
|
}: UpdatePublicProfileOptions) => {
|
|
return await prisma.team.update({
|
|
where: {
|
|
id: teamId,
|
|
members: {
|
|
some: {
|
|
userId,
|
|
},
|
|
},
|
|
},
|
|
data: {
|
|
profile: {
|
|
upsert: {
|
|
create: data,
|
|
update: data,
|
|
},
|
|
},
|
|
},
|
|
include: {
|
|
profile: true,
|
|
},
|
|
});
|
|
};
|