fix: PATCH /me formatted timezone incorrectly (#15830)
This commit is contained in:
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();
|
||||
}
|
||||
Reference in new issue
Block a user