fix: PATCH /me formatted timezone incorrectly (#15830)

This commit is contained in:
Morgan authored and GitHub committed 2024-07-19 08:49:59 +00:00
1 parent 1c8d0eda45
commit 7cdecf57e0
3 files changed
+17 -20

No files matched your search

@@ -159,10 +159,6 @@ export class UsersRepository {
if (userInput.weekStart) {
userInput.weekStart = userInput.weekStart;
}
if (userInput.timeZone) {
userInput.timeZone = capitalizeTimezone(userInput.timeZone);
}
}
setDefaultSchedule(userId: number, scheduleId: number) {
@@ -194,17 +190,3 @@ export class UsersRepository {
return profiles.map((profile) => profile.user);
}
}
function capitalizeTimezone(timezone: string) {
const segments = timezone.split("/");
const capitalizedSegments = segments.map((segment) => {
return capitalize(segment);
});
return capitalizedSegments.join("/");
}
function capitalize(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
}