chore: Remove deprecated logo/avatar/away fields (#14705)
* chore: Remove deprecated logo/avatar/away fields * Use right variables for accounts-step-card * Remove more deprecated logo/avatar usage * Dont drop the fields until all usages are gone * Remove the avatar/logo drops for staggered release * fix: Typescript blindspot (unvalidated include fields) * fix: Further updates (mostly to API) typescript missed --------- Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Bailey Pumfleet <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
15 files changed
+105
-85
No files matched your search
@@ -2,6 +2,32 @@ import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
import { prisma } from "@calcom/prisma";
|
||||
|
||||
export const uploadAvatar = async ({ userId, avatar: data }: { userId: number; avatar: string }) => {
|
||||
const objectKey = uuidv4();
|
||||
|
||||
await prisma.avatar.upsert({
|
||||
where: {
|
||||
teamId_userId_isBanner: {
|
||||
teamId: 0,
|
||||
userId,
|
||||
isBanner: false,
|
||||
},
|
||||
},
|
||||
create: {
|
||||
userId: userId,
|
||||
data,
|
||||
objectKey,
|
||||
isBanner: false,
|
||||
},
|
||||
update: {
|
||||
data,
|
||||
objectKey,
|
||||
},
|
||||
});
|
||||
|
||||
return `/api/avatar/${objectKey}.png`;
|
||||
};
|
||||
|
||||
export const uploadLogo = async ({
|
||||
teamId,
|
||||
logo: data,
|
||||
Reference in new issue
Block a user