Add OpenAPI docs, frontend, migrations, and API updates
- OpenAPI: add missing endpoints (add-from-url, subscriptions, public availability) - OpenAPI: CalendarSubscription schema, Subscriptions tag - Frontend app - Migrations: count_for_availability, subscriptions_sync, user_preferences, calendar_settings - Config, rate limit, auth, calendar, booking, ICS, availability, user service updates Made-with: Cursor
This commit is contained in:
@@ -33,16 +33,41 @@ func (s *UserService) GetMe(ctx context.Context, userID uuid.UUID) (*models.User
|
||||
return &user, nil
|
||||
}
|
||||
|
||||
func (s *UserService) Update(ctx context.Context, userID uuid.UUID, timezone *string) (*models.User, error) {
|
||||
if timezone != nil {
|
||||
if err := utils.ValidateTimezone(*timezone); err != nil {
|
||||
type UserUpdateInput struct {
|
||||
Timezone *string
|
||||
WeekStartDay *int
|
||||
DateFormat *string
|
||||
TimeFormat *string
|
||||
DefaultEventDurationMinutes *int
|
||||
DefaultReminderMinutes *int
|
||||
ShowWeekends *bool
|
||||
WorkingHoursStart *string
|
||||
WorkingHoursEnd *string
|
||||
NotificationsEmail *bool
|
||||
}
|
||||
|
||||
func (s *UserService) Update(ctx context.Context, userID uuid.UUID, in *UserUpdateInput) (*models.User, error) {
|
||||
if in == nil {
|
||||
in = &UserUpdateInput{}
|
||||
}
|
||||
if in.Timezone != nil {
|
||||
if err := utils.ValidateTimezone(*in.Timezone); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
u, err := s.queries.UpdateUser(ctx, repository.UpdateUserParams{
|
||||
ID: utils.ToPgUUID(userID),
|
||||
Timezone: utils.ToPgTextPtr(timezone),
|
||||
ID: utils.ToPgUUID(userID),
|
||||
Timezone: utils.ToPgTextPtr(in.Timezone),
|
||||
WeekStartDay: utils.ToPgInt2Ptr(in.WeekStartDay),
|
||||
DateFormat: utils.ToPgTextPtr(in.DateFormat),
|
||||
TimeFormat: utils.ToPgTextPtr(in.TimeFormat),
|
||||
DefaultEventDurationMinutes: utils.ToPgInt4Ptr(in.DefaultEventDurationMinutes),
|
||||
DefaultReminderMinutes: utils.ToPgInt4Ptr(in.DefaultReminderMinutes),
|
||||
ShowWeekends: utils.ToPgBoolPtr(in.ShowWeekends),
|
||||
WorkingHoursStart: utils.ToPgTextPtr(in.WorkingHoursStart),
|
||||
WorkingHoursEnd: utils.ToPgTextPtr(in.WorkingHoursEnd),
|
||||
NotificationsEmail: utils.ToPgBoolPtr(in.NotificationsEmail),
|
||||
})
|
||||
if err != nil {
|
||||
if err == pgx.ErrNoRows {
|
||||
|
||||
Reference in New Issue
Block a user