Co-authored-by: Amit Sharma <[email protected]> Co-authored-by: Hariom <[email protected]> Co-authored-by: Syed Ali Shahbaz <[email protected]>
This commit is contained in:
20 files changed
+454
-23
No files matched your search
@@ -91,6 +91,7 @@ export const meHandler = async ({ ctx, input }: MeOptions) => {
|
||||
username: user.profile?.username ?? user.username ?? null,
|
||||
profile: user.profile ?? null,
|
||||
profiles: allUserEnrichedProfiles,
|
||||
organizationSettings: user?.profile?.organization?.organizationSettings,
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
@@ -41,6 +41,14 @@ const updateOrganizationSettings = async ({
|
||||
data.adminGetsNoSlotsNotification = input.adminGetsNoSlotsNotification;
|
||||
}
|
||||
|
||||
if (input.hasOwnProperty("allowSEOIndexing")) {
|
||||
data.allowSEOIndexing = input.allowSEOIndexing;
|
||||
}
|
||||
|
||||
if (input.hasOwnProperty("orgProfileRedirectsToVerifiedDomain")) {
|
||||
data.orgProfileRedirectsToVerifiedDomain = input.orgProfileRedirectsToVerifiedDomain;
|
||||
}
|
||||
|
||||
// If no settings values have changed lets skip this update
|
||||
if (Object.keys(data).length === 0) return;
|
||||
|
||||
@@ -131,7 +139,7 @@ export const updateHandler = async ({ ctx, input }: UpdateOptions) => {
|
||||
|
||||
if (!prevOrganisation) throw new TRPCError({ code: "NOT_FOUND", message: "Organisation not found." });
|
||||
|
||||
const { mergeMetadata } = getMetadataHelpers(teamMetadataSchema.unwrap(), prevOrganisation.metadata);
|
||||
const { mergeMetadata } = getMetadataHelpers(teamMetadataSchema.unwrap(), prevOrganisation.metadata ?? {});
|
||||
|
||||
const data: Prisma.TeamUpdateArgs["data"] = {
|
||||
logoUrl: input.logoUrl,
|
||||
|
||||
@@ -31,6 +31,8 @@ export const ZUpdateInputSchema = z.object({
|
||||
lockEventTypeCreation: z.boolean().optional(),
|
||||
lockEventTypeCreationOptions: z.enum(["DELETE", "HIDE"]).optional(),
|
||||
adminGetsNoSlotsNotification: z.boolean().optional(),
|
||||
allowSEOIndexing: z.boolean().optional(),
|
||||
orgProfileRedirectsToVerifiedDomain: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export type TUpdateInputSchema = z.infer<typeof ZUpdateInputSchema>;
|
||||
Reference in new issue
Block a user